From f2dc198ae1d145743860ab7d4f523d54eafd4ca1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 1 Nov 2009 13:38:50 -0800 Subject: thread_pool: comment for potential SMP issue under 1.9 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. --- lib/rainbows/thread_pool.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3-24-ge0c7