From 812df45ef78bee506a4923d2b1498cdc66aebff1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 2 Apr 2008 05:51:40 +0000 Subject: *** empty log message *** --- ev.pod | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ev.pod b/ev.pod index 47204ab..81dd6a9 100644 --- a/ev.pod +++ b/ev.pod @@ -277,6 +277,10 @@ flags. If that is troubling you, check C afterwards). If you don't know what event loop to use, use the one returned from this function. +Note that this function is I thread-safe, so if you want to use it +from multiple threads, you have to lock (note also that this is unlikely, +as loops cannot bes hared easily between threads anyway). + The default loop is the only loop that can handle C and C watchers, and to do this, it always registers a handler for C. If this is a problem for your app you can either @@ -468,6 +472,10 @@ always distinct from the default loop. Unlike the default loop, it cannot handle signal and child watchers, and attempts to do so will be greeted by undefined behaviour (or a failed assertion if assertions are enabled). +Note that this function I thread-safe, and the recommended way to use +libev with threads is indeed to create one loop per thread, and using the +default loop in the "main" or "initial" thread. + Example: Try to create a event loop that uses epoll and nothing else. struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV); -- cgit v1.2.3