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 multiple threads call ev_async_send() at the same time.

In the libev documentation there is a examplous callback function that 
does something like this:

#v+
pthread_lock(&mutex);
 while(queue_not_empty)
  process(data_from_queue);
pthread_unlock(&mutex)
#v-

however I would like to be able to make a callback like:

#v+
pthread_lock(&mutex);
 data = get_data_from_shared_queue();
pthread_unlock(&mutex);

process(data);
#v-


Thanks for your answers.


-- 

Marek Denis 
[[email protected]]

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to