Fwd: need some detail about ev_async.

Zsbán Ambrus ambrus at math.bme.hu
Tue Nov 22 12:35:18 CET 2011

On Tue, Nov 22, 2011 at 12:01 PM, Marc Lehmann <schmorp at schmorp.de> wrote:
> On Mon, Nov 21, 2011 at 10:11:40PM +0100, Zsbán Ambrus <ambrus at math.bme.hu> wrote:
>> believe), eventfd is not supported.  I think this implementation can
>> block if the pipe is full, which could happen eg. if you are calling
>> ev_async_send many times (even on different ev_async watchers).  In
> the pipe is non-blocking, so it will not block even in this very unlikely
> case.

Ah, the fd_intern function does that.  I missed that when reading the code.

> even in released versions this write is guarded by a flag, and usually not
> done more than once per event-loop iteration.

> the old flag implementation worked because it was just an optimisation.
> the new dual-flag needs memory barriers (well, not on existing x86 cpus,
> but libev provides the barriers just in case) for correctness.

Thank you.  That answers both the original question and my worries.


More information about the libev mailing list