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  2010  <20112012  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  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: asyn interrupts... racing conditions?:w
From: "Mark Rivers" <[email protected]>
To: <[email protected]>, "EPICS tech-talk" <[email protected]>
Date: Tue, 22 Feb 2011 19:09:44 -0600
There is really no way for the asyn port driver to know when the waveform record is done processing.
 
But why do 2 callbacks from your driver?  Why not just do the callback to update the waveform record, and then have the waveform record forward link to the record that does the copy?  That way you only need 1 callback, and you are guaranteed that the waveform is updated before the copy is done.  If you don't want to do the copy every time you update the waveform, then make a little database that does the 2 operations, and that database run by the driver callback.
 
Mark
 

________________________________

From: [email protected] on behalf of [email protected]
Sent: Tue 2/22/2011 6:32 PM
To: EPICS tech-talk
Subject: asyn interrupts... racing conditions?:w



I have an asyn port thread that generates SEVERAL I/O Interrupts.
Now the issue I have is that one of this interrupt update a waveform,
while another triggers the copy of the same waveform.

In code, the sequence is as follow:
1. interrupt to update waveform(compress)
2. interrupt to copy waveform

well, it seems that the copy of the waveform in (2) is the one
BEFORE the waveform is updated in (1)

Is this because the update of the waveform/compress is taking longer.
As a result, this record is not updated when (2) is executing?

It seems to be a race condition...
I guess a simple sleep could solve the problem, but just out of curiosity
is there a way to control processing of a record is completed before the waveform
copy is executedi/interrupt 2 is emitted?

--
Emmanuel




References:
asyn interrupts... racing conditions?:w emmanuel_mayssat

Navigate by Date:
Prev: asyn interrupts... racing conditions?:w emmanuel_mayssat
Next: epics on FreeBSD: broadcast problem Gerrit Kühn
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: asyn interrupts... racing conditions?:w emmanuel_mayssat
Next: epics on FreeBSD: broadcast problem Gerrit Kühn
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·