On Sat, Jan 14, 2012 at 1:23 AM, Zaheer Ahmad <zaheer....@gmail.com> wrote:

> "Whenever you want to start/stop a watcher or do other modifications to
> an event loop," so its unclear to me which other api are not thread safe
> apart from "ev_<>_start/stop". Are ev_<>_init, ev_feed_event,
> ev_clear_pending, ev_async_send safe?
>

ev_async_send() is explicitly documented as thread-safe.  For other
functions, as you've quoted above: if they modify the event loop, they're
not thread-safe.  So from your list, ev_feed_event() and ev_clear_pending()
are not thread-safe because they modify an event loop.  ev_X_init doesn't
touch the loop, but it's as safe as any other variable initialization.  It
doesn't do any internal locking, so two concurrent ev_X_init on the same
memory from different threads of execution would be unsafe.

-- Brandon
_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to