On 02/08/2018 12:00 AM, Hartman, Steven M. wrote:
>
>> On Feb 7, 2018, at 5:31 PM, Simon Reiter <[email protected]> wrote:
>>
>>> state check {
>>> when(pv_mem < 2) {
>>> } state check_valid
>>> when(pv_rate != 0) {
>>> } state check
>>> when(pv_rate == 0 && delay(Waittime)) {
>>> } state check_failed
>>> }
>
> I would avoid the
>
> when(pv_rate != 0) {
> } state check
>
> in the check state as that will just loop, burning CPU. Try something like this . . .
>
>
> state check {
> when(pv_mem < 2) {
> } state check_valid
> when(pv_rate == 0 {
> } state check_delay
> }
> state check_delay {
> when(pv_rate != 0) {
> } state check
> when (pv_rate == 0 && delay(Waittime)) {
> } state check_failed
> }
>
Yes, exactly. The original program with the busy loop can prevent any
threads with lower or equal priority (such as CA event threads) from
executing. This may work in some circumstances, depending on the details
of how the scheduler is configured but is not something I would rely on.
Steven's alternative with two states works reliably and does not depend
on how the scheduler works.
Cheers
Ben
--
"Make it so they have to reboot after every typo." ― Scott Adams
Attachment:
signature.asc
Description: OpenPGP digital signature
- References:
- Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Ralph Lange
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Ralph Lange
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Benjamin Franksen
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Benjamin Franksen
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Andrew Johnson
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Andrew Johnson
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Simon Reiter
- Re: Sequencer seem to skip states with EPICS 3.16.1 Hartman, Steven M.
- Navigate by Date:
- Prev:
Re: Scanning on event number fails with EPICS 3.16 Dirk Zimoch
- Next:
RE: Data format using NDFileHDF5 ulrik.pedersen
- 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: Sequencer seem to skip states with EPICS 3.16.1 Hartman, Steven M.
- Next:
Fwd: JSPS Postdoctral Fellowships for Research in Japan Noboru Yamamoto
- 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
|