EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: epicsTimer and rounding
From: "Hill, Jeff" <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 8 Jun 2012 16:56:02 +0000
> We weren't discussing your C++ epicsTimer API at all, please don't confuse
> the issue.

Actually my understanding is that Ralph is requesting two action items.

1) Remove the compensation in the epicsTimer class which subtracts one half quantum from the timer's expiration time stamp. This is accepting going to a new behavior where on average timers will expire one half tick too late (the regression tests should verify this) but is presumably needed because we prefer behavior where timers never expire as much as one half tick too early (as is the case now).

2) Make all epicsThreadSleep implementations follow the application developer's guide and implement epicsThreadSleep(double ss) as follows.

ss <= 0.0                sleep for 0 ticks
0 < ss <= 1 tick         sleep for 1 tick (typical actual delay between 1 and 2 ticks)
1 tick < ss <= 2 tick    sleep for 2 ticks (typical actual delay between 2 and 3 ticks)
2 tick < ss <= 3 tick    sleep for 3 ticks (typical actual delay between 3 and 4 ticks)

Of course what is typical is actually OS specific so changes to OS specific implementations may need some care. Nevertheless, we prefer some consistency when the delay granularity is a tick (maybe not always the case looking briefly at the posix code).

I don’t want belabor the discussion, BION. Do we have a consensus to implement Ralph's requested behavior change?

Jeff

> -----Original Message-----
> From: Andrew Johnson [mailto:[email protected]]
> Sent: Friday, June 08, 2012 10:17 AM
> To: Hill, Jeff
> Cc: [email protected]
> Subject: Re: epicsTimer and rounding
> 
> Hi Jeff,
> 
> On 2012-06-08 Hill, Jeff wrote:
> > > I agree with Kay, that we have two different scenarios here and as a
> > > result we need two different APIs.
> >
> > As I recall, in the current API, periodicity is determined by the return
> > value from the timer expire function.
> 
> We weren't discussing your C++ epicsTimer API at all, please don't confuse
> the
> issue.  This is a discussion about the routine declared in epicsThread.h
> and
> implemented variously in libCom/osi/os/*/osdThread.c
> 
> epicsShareFunc void epicsShareAPI epicsThreadSleep(double seconds);
> 
> - Andrew
> --
> Never interrupt your enemy when he is making a mistake.
> -- Napoleon Bonaparte


Replies:
Re: epicsTimer and rounding Ralph Lange
References:
Re: epicsTimer and rounding Kasemir, Kay
Re: epicsTimer and rounding Andrew Johnson
RE: epicsTimer and rounding Hill, Jeff
Re: epicsTimer and rounding Andrew Johnson

Navigate by Date:
Prev: Re: epicsTimer and rounding Andrew Johnson
Next: Re: epicsTimer and rounding Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epicsTimer and rounding Ralph Lange
Next: Re: epicsTimer and rounding Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 26 Nov 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·