Fork watcher will not be called if fork() is invoked in prepare watcher callback.

李晓岚 LeeXiaolan+libev at gmail.com
Sat May 3 04:43:26 CEST 2014


On Fri, May 2, 2014 at 3:05 PM, Marc Lehmann <schmorp at schmorp.de> wrote:
> Therefore, we decided to forbid invocations of ev_loop_fork from prepare
> watchers.
>
> If you have a convincing use case that couldn't be served by starting an
> ev_idle watcher and forking from there, we'd be interested in hearing
> about it :)

Maybe you know gevent. Gevent use libev as its event loop. When new
greenlet is spawned, its first run is scheduled in prepare watcher. It
is make no sense to forbid invocations of fork in new greenlet's first
run, and ev_idle is also not the right choice.

>
> --
>                 The choice of a       Deliantra, the free code+content MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
>       -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list