ev_prepare watcher awkwardness

Marc Lehmann schmorp at schmorp.de
Sat Apr 18 08:49:19 CEST 2015


On Fri, Apr 17, 2015 at 07:46:00PM +0200, Thilo Schulz <thilo at tjps.eu> wrote:
> I am currently working around this by always
> also installing an idle watcher to make sure the program doesn't block for at
> least one event loop iteration. But like I said, this solution is rather awkward.

The problem is that ev_prepare watchers have a special purpose and special
semantics - you can't do everything inside one. While you can make a hack
that calls newly-added prepare watchers, the awkwardness, as you call it,
remains (a prepare watcher callback *has* to be aware that is is a prepare
callback, it's not a normal callback), but the rules have become more
complex, which is a loss-loss situation to me.

I think chances are high that you are using ev_prepare watchers for
something they were not meant for (integrating other event sources), and
likely, the awkwardness will go away once you stop doing that.

-- 
                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