[Libevent-users] Add support for WINDOWS Overlapped IO

Steven Grimm sgrimm at facebook.com
Sun Dec 10 17:29:24 EST 2006


Toby Douglass wrote:
> Single-thread event-driven seems to me to basically mean state 
> machine.  State machines are wonderful things for achieving simple, 
> bug-free code, but they have a cost; they are implicitly 
> single-threaded.  This can mean you cannot use them in some 
> situations, because you will inherently block whenever you perform work.

That's not strictly true; you can, for example, have multiple state 
machines running concurrently (the implementation strategy I used when I 
added thread support to memcached). Or you can have a single thread 
responsible for I/O operations that hands work off to other threads that 
perform whatever blocking operations they need. Or you can combine the 
two and have a small set of I/O management threads and a larger set of 
worker threads.

The right strategy depends on the particulars of the application, of course.

-Steve


More information about the Libevent-users mailing list