On 9/29/08 7:05 PM, Andrew Johnson wrote:
snip
> If anyone has any better ideas I'm open to them (working code particularly
> welcomed), but this issue is not going to be solved in R3.14.10.
Hi, Andrew.
As a first step, I could see adding a function such as
void epicsThreadSetSleepQuantum(double quantum);
If someone knows what the sleep quantum should be for their particular
machine (by experiment or otherwise), they can set it explicitly (at IOC
boot time or whenever). If this function is never called,
epicsThreadSleepQuantum() behaves just as it does now. But if
epicsThreadSetSleepQuantum() has been called, epicsThreadSleepQuantum()
returns the explicitly set quantum.
A step beyond this first step might not be a good idea. But if one was
to try to implement a step 2 by tackling the problem of automatically
determining the actual sleep quantum, perhaps a function could be added
with this signature:
void epicsThreadCalibrateSleepQuantum(void);
This function would use an algorithm to determine the actual sleep
quantum and set it via step 1's epicsThreadSetSleepQuantum(). If the
user would like to potentially get a more accurate sleep quantum than
what is reported by epicsThreadSleepQuantum(), he or she could call this
function (at IOC boot time or whenever). Again, the default is the
behavior we have now; the user would have to explicitly call this
function to get this new behavior.
What algorithm to use is where things might become difficult. I could
see it being difficult to come up with an algorithm that would correctly
determine a good actual sleep quantum for the wide range of hardware and
operating systems on which EPICS runs.
Lewis
--
J. Lewis Muir
Software Engineer
IMCA-CAT/CARS
- References:
- epicsThreadSleep() and epicsThreadSleepQuantum() Mark Rivers
- Re: epicsThreadSleep() and epicsThreadSleepQuantum() Andrew Johnson
- Navigate by Date:
- Prev:
Re: epicsThreadSleep() and epicsThreadSleepQuantum() David Dudley
- Next:
Re: Base R3.14.10-RC1 Released J. Lewis Muir
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: epicsThreadSleep() and epicsThreadSleepQuantum() Andrew Johnson
- Next:
Base R3.14.10-RC1 Released Andrew Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|