about summary refs log tree commit homepage
diff options
context:
space:
mode:
-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|