From 2d25a86d1d17bd966eea59e5666e41d9da562811 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Dec 2010 02:59:10 +0000 Subject: thread_pool: avoid needless wakeups from select No point in waking up when our ticker runs in a separate thread. --- lib/rainbows/thread_pool.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index f6420ae..f243dc5 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -54,7 +54,7 @@ module Rainbows::ThreadPool # 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[0].each do |s| + ret = select(LISTENERS) and ret[0].each do |s| s = s.kgio_tryaccept and process_client(s) end rescue Errno::EINTR -- cgit v1.2.3-24-ge0c7