On Wed, Dec 28, 2011 at 6:08 PM, Chris Brody <[email protected]> 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: [email protected]
Chamber of commerce no: 08173483 (The Netherlands)

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to