g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: epicsTimer and rounding
From: Ralph Lange <Ralph.Lange@gmx.de>
To: EPICS Core Talk <core-talk@aps.anl.gov>
Cc: Dirk Zimoch <dirk.zimoch@psi.ch>
Date: Wed, 06 Jun 2012 12:31:29 +0200
Hi,

While helping us with finding a weird behavior in a StreamDevice based
interface, Dirk Zimoch found the following:

When adapting the expire period (requested as a double value in seconds)
to the matching amount of sleep quantums, the current implementation of
epicsTimer rounds mathematically (line 71 of timer.cpp subtracts half a
quantum from the expire time). So, for requested expire periods in the
same order as the quantum, the actual expire period used by the timer is
up to 100% shorter than the requested period.

In the section about epicsTimer, the App Developers' does not make a
statement about the relation between requested and actual period.

IMHO, the actual expire period should always be equal or larger than the
requested value, i.e. the implementation should always round up when
converting to quantums. (And the doc should mention this behavior.)

What do you think?

Cheers,
~Ralph


Replies:
RE: epicsTimer and rounding Hill, Jeff

Navigate by Date:
Prev: [Merge] lp:~mdavidsaver/epics-base/epicsconf into lp:epics-base/3.14 Andrew Johnson
Next: RE: epicsTimer and rounding Hill, Jeff
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: [Merge] lp:~mdavidsaver/epics-base/epicsconf into lp:epics-base/3.14 Andrew Johnson
Next: RE: epicsTimer and rounding Hill, Jeff
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 26 Nov 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·