Feature request: ability to use libeio with multiple event loops

Hongli Lai hongli at phusion.nl
Tue Dec 20 21:26:20 CET 2011

On Tue, Dec 20, 2011 at 4:17 PM, Marc Lehmann <schmorp at schmorp.de> wrote:
> global variables are entirely fine with threads (libeio itself uses
> threads).

I know, but that's not what I mean. I'm talking about reentrancy.
Right now the libeio API assumes that there is one event loop. The
want_poll callback assumes that I wake up *the* event loop in which I
am supposed to call eio_poll().

After studying libeio a bit more I understand how to make it work with
multiple event loops, but the thing is that I want libeio callbacks to
be called from the right event loop, namely the requester's event
loop. I can make this work by passing a reference to the wanted event
loop as user data to the callbacks, and then have the callbacks call
another callback on that event loop. But I'll have to do this for
*every* libeio call so this gets ugly real fast.

Would you be open to accepting a patch that implements
EIO_MULTIPLICITY support, similar to EV_MULTIPLICITY? You can disable
it by default if you like.

> This is strictly less useful though, as you lose control over scheduling,> which might not be an issue for you though.

It is not an issue for me.
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: info at phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

More information about the libev mailing list