Feature request: ability to use libeio with multiple event loops

Hongli Lai hongli at phusion.nl
Wed Dec 28 18:29:48 CET 2011

On Wed, Dec 28, 2011 at 6:08 PM, Chris Brody <chris.brody at gmail.com> wrote:
> 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.

Thanks for the answer Chris, but I've already solved my problem using
a bunch of wrapper code. My problem was never about thread-safety to
begin with, it was about finding a way to correctly and easily
distributing callbacks to the originating event loop/thread, and the
easiest way to do that IMO is to make libeio reentrant (i.e. not
relying on global variables).

The only thing left that I'm interested in is why Marc thinks
processes are more efficient than threads. I'm interested in his
answer because I wish to learn more about how hardware and operating
systems work.

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