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: Mark Rivers via Core-talk <[email protected]>
To: "'Konrad, Martin'" <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 11 Jun 2019 13:57:10 +0000
> If we want to sleep for a minimum amount of time we might want to call nanosleep(0) instead.

But that will not work on Windows or vxWorks.

Mark


-----Original Message-----
From: Konrad, Martin <[email protected]> 
Sent: Tuesday, June 11, 2019 8:49 AM
To: Mark Rivers <[email protected]>; [email protected]
Subject: Re: epicsThreadSleep and epicsThreadSleepQuantum

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 Michael Davidsaver via Core-talk
References:
epicsThreadSleep and epicsThreadSleepQuantum Konrad, Martin via Core-talk
Re: epicsThreadSleep and epicsThreadSleepQuantum Konrad, Martin via Core-talk

Navigate by Date:
Prev: Re: epicsThreadSleep and epicsThreadSleepQuantum Konrad, Martin via Core-talk
Next: Re: epicsThreadSleep and epicsThreadSleepQuantum Konrad, Martin 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 Konrad, Martin via Core-talk
Next: Re: epicsThreadSleep and epicsThreadSleepQuantum Michael Davidsaver 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, 12 Jun 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·