[patch] event_loopbreak()

Marc Lehmann schmorp at schmorp.de
Tue Jul 7 10:50:14 CEST 2009

On Tue, Jul 07, 2009 at 11:11:18AM +0400, Antony Dovgal <tony at daylessday.org> wrote:
> > Assuming your patch is flawed and your intention was to implement the
> > function as dcoumented by libevent, I am still reluctant to slow down one
> > of the central inner loops, and libev seems to be strong enough nowadays
> > as to not require full libevent api support anymore, so, what's a use case
> > for this, I cannot imagine any?
> Well, I can certainly imagine applications trying to switch from libevent to libev 
> and stumbling upon this incompatibility. This is how I found it, in fact.

It's not really an incompatibility, the function simply didn't exist in older
versions of the API, which libev implements.

> > (I assume the patch is a proof-of-concept patch, if I were to accept
> > the feature, it would need documenttaion, proper formatting, and the
> > MULTIPLICITY changes need to be removed - but I still need a good reason
> > for this functionality).
> The reason is to have support of event_base_loopbreak()
In that case, that's not a good reason for functionality to go in, as this
doesn't achieve anything.

> If you think it can be done with ev_unloop() - even better, and I'm
> ready to re-write the patch using that function.

Your patch seems to implement just another version of EV_UNLOOP, as far
as I can see, so event_break could be implemented simply by calling
ev_unloop(EVUNLOOP_ONCE) or so.

I wouldn't have a problem if the event_break* fucntionality would be
implemented that way, i.e. without any changes to the libev core, but I
suspect that libevent has different semantics.

Maybe substituting the ev_unloop behaviour is good enough for apps,
maybe not (there are other minor incompatibilities). To implement the
actual libevent-like functionality, I would need a reason, however, and
"implementing it so it is implemented" is not a reason.


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

More information about the libev mailing list