ev_async watcher's callback is never triggering on ev_async_send()

trafdev trafdev at mail.ru
Sun Jun 30 18:30:25 CEST 2013

Oh, I see.
Many thanks to you, Marc. Using libev in 24\7 services which are up for 
more then
2 years with millions requests handled per hour.

Trying to rewrite code from
NUM_CORE processes listening and processing incoming requests
one thread listening\accepting requests, NUM_CORE threads processing 
Expecting significant performance increase - processes switch must be 
more expensive then
async watchers\mutexes overheads.

On Sun Jun 30 06:41:37 2013, Marc Lehmann wrote:
> On Sat, Jun 29, 2013 at 07:35:00PM -0700, trafdev <trafdev at mail.ru> wrote:
>> but looks like loop may have multiple watchers of same type as well
>> as single watcher may be assigned to multiple loops.
> Watchers can only ever be active in one loop at a time. When a watcher
> is stopped, though, it's completely detached from the loop, so you could
> then assign it to another loop.
>> That explains why ev_async_send requires both loop and watcher, this was
>> surprise for me...
> Yes, it's not so common in event loops, but since libev tries to go for
> small size, it doesn't store the loop inside the watcher unless necessary.

More information about the libev mailing list