[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] silly question: 1.x to 2.x event_add behavior
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] silly question: 1.x to 2.x event_add behavior
- From: Denis Hainsworth <denis@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2014 08:24:23 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Wed, 30 Apr 2014 08:24:44 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:reply-to:mime-version :content-type:content-disposition:user-agent; bh=0Bkta6qz3kUxoP4xck9uDU6AnXJBO55Tov6Hgn6WWx4=; b=HP0+osmwQ8MkJBgkNo22o+I8xPjqWoKMFvfo7OKn4xVxlJ4cfGV9uvDpF9oqRechp7 dSW0Y334EWMPu3GR2/4/NaofsRfgJF8Bmnp1DsLb1gUNa+jsVZnj+MV7DStjAYZ+T0yL PMIE/j/H7oehAyQXRSPReIUjrLDTTmELP3cH+VcfVIUq8iI0hdaE7QwvyVp2PhN1YahG f58aRLYoBzqUIVBrthheuJ80/dNDNCk/0zgMFYJUBlRhLfoLJ04diq0WyHEfWG4iRsT3 SfjclbuWAgnwDPDU5pP0kUW/HvLVs/rQzxuAdQPWTsxkp/13woZ57dn/iSp6Y92I+bDi kM3g==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
- User-agent: Mutt/1.5.21 (2010-09-15)
I have question I'm hoping will short-cut an investigation I'm doing
into some inherited code. Essentially we have some real simple code
which sets up an event with a timer and depending on certain things
changes the timer during each loop. We are seeing a difference in
behavior from when it was using 1.x libevent and 2.x.
We call event_set at the start of the code for 60 seconds, and then
during each loop use event_add to set the timer to however many seconds
from current time to get to the next minute. Its pretty dumb code and
there are lots of things wrong with it but it has been working.
We recently noticed that after upgrade to libevent 2.x as well as many
other things it appears that changing the timout via event_add doesn't
reset the current timer. I did some quick looking for bug reports and
in the manuals and I couldnt find any indication that the libevent code
had changed but I also couldnt confirm which is the correct behavior.
1.x - call event_add with a timeout and the next callback seems to be
exactly timeout time from the time we called event_add
2.x - call event_add with a timeout and the next callback seems to be
exactly timeout time from the beginning of the current loop, as if the
timeout is being properly set but the current timer is not being reset
when before it seemed to be.
I will note we are still using event_set with 2.x even though its
deprecated. So I was curious if anyone could say "duh" this is becuase
you are using event_set, or this is because there is a known bug that
was fixed in 2.x.x, or there was a change with this function somewhere
along the line. At the very least I was hoping someone could confirm
what the behavior we should be expecting when calling event_add.
Sorry for the bother, but any advice would be much appreciated as this
is inherited code it may take a while to unravel the original author's
intent.
-denis
--
__________________________
Denis Alan Hainsworth
denis@xxxxxxxxxxxxxxxxxxx
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.