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

Re: [Libevent-users] Proposal for libevent-2 to provide functions to hide event structure details



Hello Nick,

thanks for help.

On Sunday 17 January 2010 05:02:24 Nick Mathewson wrote:
> In Libevent 2.0, if an event is persistent, then its timeout starts
> over whenever the event is triggered.  So persistent events with
> timeouts are probably what you want here.

That is better for most cases. I think, that opposite behavior
is true for libevent-1. Is that right? I consider about finishing/
making fully functional libevent-1 variant of my code still.

But even the behavior without time event final time updates
has its place for some cases.  If I understand code, then persistent
event flag (EV_PERSIST) makes event to use EV_CLOSURE_PERSIST
unconditionally. The event_persist_closure is called for each
such event. But event_persist_closure code takes care only for
timer update, because internal event add does nothing for
other event aspects, which do not change. Is there some possibility
to optionally setup persistent event without timeout updates.
It can have use in some case, where more events or whole
transfer should finish before some time. It is less frequent
that communication timeout detection, but would be helpfull to could
use internal event timer for this case without need to setup another
independent libevent timer event.

> > I would like a much to have function to restart timeout or even change
> > event timeout triggering time without need of event_del event_add
> > sequence. Because these operations means relatively costly operations for
> > some mechanisms cases (epoll for example).
>
> Well, that has never been necessary:  re-adding an already added event
> will reset its timeout without touching the FD layer.

That is interresting to know, but it is documented behavior
and expected to be kept in "all" future versions.

> > It is not necessary to manipulate by epoll/FD for these cases, it is
> > enough to delete and insert timeout into timers queue/RB-tree.
>
> (It's actually been a minheap since 1.4.x)

I see my memory does not serve right.

Thanks for cooperation,

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