Re: Calling ev_async_send() from multiple threads.

2012-06-26 Thread Marc Lehmann
On Tue, Jun 26, 2012 at 12:00:57PM +0200, Marek ma...@octogan.net wrote: Here is that A_cb(): mutex.lock() while(!queue.empty()) { data = get_data_from_hared_queue(); flow-B_notify(data); } mutex.unlock(); and B_notify(data) will look like: appropriate_queue =

Re: Calling ev_async_send() from multiple threads.

2012-06-26 Thread Gabriel Kerneis
On Tue, Jun 26, 2012 at 12:00:57PM +0200, Marek wrote: Now my question is if the flow-B_notify() will end only after the iterate_cb() function returns (so the iterate_cb will be running with mutex still locked!)? Or rather flow-B_notify() is called, inside the B_notify the watcher is triggered

Re: Calling ev_async_send() from multiple threads.

2012-06-26 Thread Marek Denis
On Tue, Jun 26, 2012 at 12:52:07PM +0200, Marc Lehmann wrote: On Tue, Jun 26, 2012 at 12:00:57PM +0200, Marek ma...@octogan.net wrote: Here is that A_cb(): mutex.lock() while(!queue.empty()) { data = get_data_from_hared_queue(); flow-B_notify(data); } mutex.unlock();

Re: Calling ev_async_send() from multiple threads.

2012-06-25 Thread Marc Lehmann
On Mon, Jun 25, 2012 at 12:52:35AM +0200, Marek Denis ma...@octogan.net wrote: different threads is a safe technique. However I am not really sure, whrther those calls will trigger callback functions the exact number of They don't. It works like any other watcher, such as timers or I/O

Calling ev_async_send() from multiple threads.

2012-06-24 Thread Marek Denis
Hi, As far as I understood calling ev_async_send() on one watcher, but from different threads is a safe technique. However I am not really sure, whrther those calls will trigger callback functions the exact number of times the ev_async_send() was called? I am talking about the situation when