Re: several questions about libev

2012-07-04 Thread Marc Lehmann
On Wed, Jul 04, 2012 at 04:59:05PM +0200, Jorge wrote: > if (!ev_async_pending(&watcher)) ev_async_send(EV_DEFAULT_UC_ &watcher); > > that expands to: > > if (!(+(&watcher)->sent)) ev_async_send(ev_default_loop_uc_ (), &watcher); > > In all my background (p)threads... > > Should I avoid that

Re: several questions about libev

2012-07-04 Thread Jorge
On 01/07/2012, at 22:04, Marc Lehmann wrote: > Note that ev_async_pending is not documented to be call-able from another > thread than the one that runs the event loop, so you shouldn't call it to > see anything, because it does not do any kind of synchronisation. (...) > Literally the only call

Re: several questions about libev

2012-07-01 Thread Marc Lehmann
On Sun, Jul 01, 2012 at 12:12:41PM +0800, debuguo wrote: > hello everyone, > 1.*about ev_async. *I use only one ev_async as the signal. when something > happens, call ev_async_send(loop, &watcher). before the ev_async_send, I > add one ev_async_pending(&watcher) to see the status of the watcher. >

several questions about libev

2012-06-30 Thread debuguo
hello everyone, 1.*about ev_async. *I use only one ev_async as the signal. when something happens, call ev_async_send(loop, &watcher). before the ev_async_send, I add one ev_async_pending(&watcher) to see the status of the watcher. ev_async_pending returns a non-zero value, which means "the event h