EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: epicsThreadSleep and epicsThreadSleepQuantum
From: "Konrad, Martin via Core-talk" <[email protected]>
To: Mark Rivers <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 11 Jun 2019 13:48:36 +0000
Hi,
> I started a tech-talk thread on this topic 11 years ago:
> 
> https://epics.anl.gov/tech-talk/2008/msg00987.php
Thanks Mark, I wasn't aware of this thread. I'm not aware of any way to
detect the sleep quantum reliably on modern machines either. The fact
that epicsThreadSleepQuantum() only works correctly on old machines
without high resolution timers suggests that we should avoid using it. I
think it would make sense to

a) Add a warning to the App Dev Guide.
b) Consider marking epicsThreadSleepQuantum(),
timerQueueActive::quantum(), and fdManager::quantum() as deprecated.
c) Remove the "(ppsl->period < 2 * quantum)" part of the test in [1].

If we want to sleep for a minimum amount of time we might want to call
nanosleep(0) instead. If I'm understanding the man page correctly this
should result at least in a context switch.

Thanks,

Martin

[1]
https://github.com/epics-base/epics-base/blob/3.15/src/ioc/db/dbScan.c#L822

-- 
Martin Konrad
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: [email protected]

Replies:
RE: epicsThreadSleep and epicsThreadSleepQuantum Mark Rivers via Core-talk
References:
epicsThreadSleep and epicsThreadSleepQuantum Konrad, Martin via Core-talk

Navigate by Date:
Prev: Re: epicsThreadSleep and epicsThreadSleepQuantum Mark Rivers via Core-talk
Next: RE: epicsThreadSleep and epicsThreadSleepQuantum Mark Rivers via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epicsThreadSleep and epicsThreadSleepQuantum Mark Rivers via Core-talk
Next: RE: epicsThreadSleep and epicsThreadSleepQuantum Mark Rivers via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 11 Jun 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·