need some detail about ev_async.

Uli ToBeSpammed at
Mon Nov 21 09:57:33 CET 2011


On 21.11.2011 09:14, Âí³Ðçæ wrote:
> I want to use ev_async to implement the "tell" work, so I want
> to know is there any mutext or lock in ev_async functions? will
> a thread be blocked when calling ev_async functions? what low-level
> api does ev_async used on Linux platform?

Use the source, luke!

On most platform, ev_async_send() writes a single byte to a pipe which will wake
up the other end of the pipe since there is data to read. If eventfd is
available (see man eventfd), that is used instead.

In either case, this is totally lockless and just a single syscall away.


"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451

More information about the libev mailing list