about summary refs log tree commit homepage
path: root/lib/rainbows/thread_spawn.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-05-26 22:49:49 +0000
committerEric Wong <normalperson@yhbt.net>2010-05-26 22:49:49 +0000
commit904526129a2377306a735c73b26699583b3b99c5 (patch)
tree6811262ca96fb3cf5defc1fefe7dfcc2e978409e /lib/rainbows/thread_spawn.rb
parent4ccaf0a931a0731d1dca2710b86864075eb511a1 (diff)
downloadrainbows-904526129a2377306a735c73b26699583b3b99c5.tar.gz
Diffstat (limited to 'lib/rainbows/thread_spawn.rb')
-rw-r--r--lib/rainbows/thread_spawn.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb
index 75cc150..9660fc0 100644
--- a/lib/rainbows/thread_spawn.rb
+++ b/lib/rainbows/thread_spawn.rb
@@ -33,6 +33,9 @@ module Rainbows
               # synchronization primitives for _every_ case, not just this
               # unlikely one.  Since this case is (or should be) uncommon,
               # just busy wait when we have to.
+              # We don't use Thread.pass because it needlessly spins the
+              # CPU during I/O wait, CPU cycles that can be better used
+              # by other worker _processes_.
               sleep(0.01)
             elsif c = Rainbows.sync_accept(l)
               klass.new(c) do |c|