about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-01 13:38:50 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-01 13:38:50 -0800
commitf2dc198ae1d145743860ab7d4f523d54eafd4ca1 (patch)
treeb50cf0fee352f100646f3d2993a06c9d88197fd7
parent0af9343c98b7b8d9596b526b87fd5e67bb8c4a68 (diff)
downloadrainbows-f2dc198ae1d145743860ab7d4f523d54eafd4ca1.tar.gz
The problem is unconfirmed at the moment, but I've long
anticipated it.  I just need to remember the next time I
log into a monster machine.
-rw-r--r--lib/rainbows/thread_pool.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb
index 30e8f69..6556164 100644
--- a/lib/rainbows/thread_pool.rb
+++ b/lib/rainbows/thread_pool.rb
@@ -44,6 +44,11 @@ module Rainbows
       Thread.new {
         begin
           begin
+            # TODO: check if select() or accept() is a problem on large
+            # SMP systems under Ruby 1.9.  Hundreds of native threads
+            # all working off the same socket could be a thundering herd
+            # problem.  On the other hand, a thundering herd may not
+            # even incur as much overhead as an extra Mutex#synchronize
             ret = IO.select(LISTENERS, nil, nil, 1) and
                   ret.first.each do |sock|
                     begin