EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Fwd: Sequencer bug?
From: Tim Mooney <[email protected]>
To: [email protected]
Date: Thu, 25 Feb 2010 13:13:35 -0600


On 2/25/2010 7:43 AM, Benjamin Franksen wrote:

It remains to draw practical conclusions for how to avoid such race
conditions in SNL code. Should we generally be wary of pvPut and monitor to
the same state variable? Could the compiler warn us about that? Or is this
too restrictive?

Great analysis. Thanks for that.


Wrong take-home message, though.  If you had written this in C,
your first thoughts would probably have been something like this:

"Hmmm... two tasks; shared resource; better implement a mutex"

and your life would have been less eventful.  (Sorry for the pun.
Here's another: this is a very old tale with a context switch.)

I've stabbed myself with exactly this blade more times than I can
count, in every programming language I've ever used.

I think the take-home messages are simply that SNL is not magic,
and that multitasking event-driven software is hard to get right.

Compilers can't really help with stuff like this, because you
could have the same problem by writing to X and monitoring some
other PV, Y, that gets changed as a result of the write to X.
What's really pernicious is the case in which X modifies Y
via a CA link, or via the reply to a serial device.  In these
cases, the race condition is moved out in time so you almost
never can find it in testing.

--
Tim Mooney ([email protected]) (630)252-5417
Beamline Controls & Data Acquisition Group
Advanced Photon Source, Argonne National Lab.

Replies:
Re: Fwd: Sequencer bug? Benjamin Franksen
References:
Re: Sequencer bug? Benjamin Franksen
Re: Fwd: Sequencer bug? Benjamin Franksen

Navigate by Date:
Prev: RE: Fwd: Sequencer bug? Mark Rivers
Next: Re: Fwd: Sequencer bug? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Fwd: Sequencer bug? Benjamin Franksen
Next: Re: Fwd: Sequencer bug? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·