Feature request: ability to use libeio with multiple event loops
chris.brody at gmail.com
Wed Dec 28 18:08:22 CET 2011
On Tue, Dec 20, 2011 at 2:34 PM, Hongli Lai <hongli at phusion.nl> wrote:
> I'm writing a multithreaded evented server in which I have N threads
> (N=number of CPU cores) and one libev event loop per thread. I want to
> use libeio but it looks like libeio depends on global variables so
> this isn't going to work. I'd like to request the ability to use
> libeio with multiple event loops. This probably involves changing the
> API so that each libeio function accepts a context object.
Hongli maybe this answer can help you. Yes libeio is using globals,
libeio is USING LOCKS (mutex) and conditionals so AFAIK it would be
safe to be using libeio from multiple event-loop threads.
BTW libeio uses an interesting strategy to start a thread behind the
API to do the management for the timeouts, that is behind the scenes.
More information about the libev