On Jan 10, 2013, at 6:26 AM, Jack Smith <[email protected]> wrote:
> Hi Eric, Andrew, et al:
>
> Thanks for all your explanations. I tried Eric's codes and it works. I
> think Eric's algorithm is accurate enough for compensating the time
> spent on processing the records in its chain. Now, the delay in
> epicsEventWaitWithTimeout is (scan_period - time_on_scanList).
>
> Since I have more questions in dbScan.c, I am starting a new thread ...
>
> 1. In Eric's previous email, it says "It's the
> epicsEventWaitWithTimeout(). This allows the pause to be interrupted
> early in the case of IOC shutdown.". What does "This allows the pause
> to be interrupted early in the case of IOC shutdown" mean?
Think about what would happen if the periodTask loop just did an epicsThreadSleep at that point. Things would work pretty much the same. Well, they'd work the same until someone decided to shut down the IOC. The SCAN="10 second" thread could take up to 10 seconds to reawaken and notice that ppsl->scanCtl == ctlExit and break out of the loop.
To avoid this problem the periodTask loop invokes epicsEventWaitWithTimeout to perform the delay. When the IOC begins to shut down it sets ppsl->scanCtl = ctlExit and raises the ppsl->loopEvent. The epicsEventWaitWithTimeout then returns right away, the thread breaks out of the loop and terminates.
- References:
- dbScan.c: periodicTask( ), initOnce( ), ... Jack Smith
- Navigate by Date:
- Prev:
dbScan.c: periodicTask( ), initOnce( ), ... Jack Smith
- Next:
RE: acalcOut Hu, Yong
- 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:
dbScan.c: periodicTask( ), initOnce( ), ... Jack Smith
- Next:
Re: dbScan.c: periodicTask( ), initOnce( ), ... 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
|