Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
fa03f6c8
Kaydet (Commit)
fa03f6c8
authored
Ara 05, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove the outdated notion that multithreading doesn't work well on Unices.
üst
534e253c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
sockets.rst
Doc/howto/sockets.rst
+7
-13
No files found.
Doc/howto/sockets.rst
Dosyayı görüntüle @
fa03f6c8
...
@@ -395,19 +395,13 @@ Performance
...
@@ -395,19 +395,13 @@ Performance
There's no question that the fastest sockets code uses non-blocking sockets and
There's no question that the fastest sockets code uses non-blocking sockets and
select to multiplex them. You can put together something that will saturate a
select to multiplex them. You can put together something that will saturate a
LAN connection without putting any strain on the CPU. The trouble is that an app
LAN connection without putting any strain on the CPU.
written this way can't do much of anything else - it needs to be ready to
shuffle bytes around at all times.
The trouble is that an app written this way can't do much of anything else -
it needs to be ready to shuffle bytes around at all times. Assuming that your
Assuming that your app is actually supposed to do something more than that,
app is actually supposed to do something more than that, threading is the
threading is the optimal solution, (and using non-blocking sockets will be
optimal solution, (and using non-blocking sockets will be faster than using
faster than using blocking sockets). Unfortunately, threading support in Unixes
blocking sockets).
varies both in API and quality. So the normal Unix solution is to fork a
subprocess to deal with each connection. The overhead for this is significant
(and don't do this on Windows - the overhead of process creation is enormous
there). It also means that unless each subprocess is completely independent,
you'll need to use another form of IPC, say a pipe, or shared memory and
semaphores, to communicate between the parent and child processes.
Finally, remember that even though blocking sockets are somewhat slower than
Finally, remember that even though blocking sockets are somewhat slower than
non-blocking, in many cases they are the "right" solution. After all, if your
non-blocking, in many cases they are the "right" solution. After all, if your
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment