[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] loopbreak vs. loopexit



On Sun, Aug 29, 2010 at 2:01 PM, Scott Lamb <slamb@xxxxxxxxx> wrote:
 [...]
> By an active event, I meant one which has triggered and whose callback
> needs to be called. [I see this explanation in the docstring for the
> activequeues but unless I'm missing it, not anywhere prominent in the
> documentation. And unfortunately, the main doxygen page seems to use a
> contradictory meaning in the phrase "The event structure must remain
> allocated as long as it is active".]

I'd love documentation patches to fix this up.  I tried to be
consistent in the book, but I'm not going to have a chance to do a
major editing pass on the doxygen stuff for a while. :/

I've cleaned up the book to avoid saying "Currently processing" and
instead say "running callbacks".

> event_base_loopbreak(evbase) will cause a running
> event_base_loop(evbase) to return without calling any additional
> callbacks. In constrast, event_base_loopexit(evbase, NULL) will cause
> a running event_base_loop(evbase) to return after calling the
> callbacks of all active events (but without blocking again).
>
> [I'm not being precise about the behavior when multiple threads are
> interacting with the same event_base. Can you do that with libevent2?
> I think there have been changes regarding threading, but I haven't had
> time to follow the details.]

You sure can.  The semantics for loopbreak and loopexit are still the
same as before.

[...]
> It'd make sense to switch pyevent after it drops support for any
> libevent version prior to event_base_loopbreak's introduction.
> Probably when it adopts the libevent2 API.

event_base_loopbreak first appeared in Libevent 1.4.3 , if my ctags
post-processing can be trusted.

yrs,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.