On Sat, Oct 19, 2013 at 06:52:48PM +0000, "Srini Gurusu (sgurusu)" <sgur...@cisco.com> wrote: > >watcher is the relatively costly memory synchronisation done by > >ev_async_send. > > For simplicity, if I use ev_sync_send(), > Do we need to protect ev_sync_send() as this will be called by producer > and > consumer as well on the same loop/watcher.
As long as the loop exists and the watcher is started, you should be able to call ev_async_send at any time without any protection - same thread, other thread, signal handler, inside a callback, outside a callback etc. should all be fine. It's the only function in libev that allows this. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schm...@schmorp.de -=====/_/_//_/\_,_/ /_/\_\ _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev