ccutrer/mordor — pull request #10 by kevincai (2012-03-06 08:20:25+00:00)
Title: implement separated eventThread in IOManager

Problem:
* From Scheduler perspective, every working thread should keep busy
executing fibers until there is no suitable fibers for the thread, and
then the thread enters idle().
* the principal is fine for WorkerPool but not for IOManager,
IOManager::idle() does some things that is more important or at least
as important as executing fibers -- pull I/O event & processTimers
* In a busy system, spectacularily CPU-intensive jobs like
encryption/decryption or compression/decompression, the
IOManager::idle() has less frequency to be called() which causes I/O
event delay and timer expiration delay.

Solution:
* optional have one dedicate thread to check I/O event and expired
timers, it doesn't execute fibers queued in scheduler. OS thread
scheduling will ensure this event thread won't be starved for a long
time, as a result, I/O event and expired timers can enter scheduler as
soon as possible
* Same change applied to kqueue and iocp version of IOManager

Change-Id: I6337d324d21e25bdfe0af304a6521b555424094f
Signed-off-by: Kevin Cai