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 18:10:28 +0000
Hi Mark,
>> If we want to sleep for a minimum amount of time we might want to
>> call nanosleep(0) instead.
Sorry, I actually meant to say "epicsThreadSleep(0)" here.

> But that will not work on Windows or vxWorks.
On Windows epicsThreadSleep is implemented using Sleep(). Sleep(0)
behaves similar to nanosleep(0):

"A value of zero causes the thread to relinquish the remainder of its
time slice to any other thread that is ready to run." [1]

For vxWorks' taskDelay(0) I'm not 100% sure - the documentation I found
[2] doesn't say explicitly. But the fact that epicsThreadSleep() clamps
negative arguments to 0 [3] suggests that taskDelay(0) does what you
would expect it to do...

-Martin

[1]
https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-sleep
[2]
https://www.ee.ryerson.ca/~courses/ee8205/Data-Sheets/Tornado-VxWorks/vxworks/ref/taskLib.html#taskDelay
[3]
https://github.com/epics-base/epics-base/blob/3.15/src/libCom/osi/os/vxWorks/osdThread.c#L311

-- 
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]

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 Mark Rivers via Core-talk
Next: EPICS 7 PVA for Java Williams Jr., Ernest L. 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: EPICS 7 PVA for Java Williams Jr., Ernest L. 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, 14 Jun 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·