EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  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  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: FLNK loop
From: Andrew Johnson <[email protected]>
To: "Chestnut, Ronald P." <[email protected]>
Cc: Emmanuel Mayssat <[email protected]>, [email protected]
Date: Tue, 14 Feb 2006 14:52:03 -0600
Chestnut, Ronald P. wrote:
Yes. Records are "Active" until all the related processing is done.
Active records are not "refired".

in reply to Emmanuel Mayssat's question:
I just wanted to have confirmation that in the case of a FLNK loop (
2 records FLNK to one another ), the loop stops once before
processing an already processed record.

While Ron is right about this most all the time, there are circumstances where two records can FLNK each other and cause a loop; both records must have asynchronous device support for that to occur.


Here's the timeline with two synchronous records, showing how we break these loops using the record PACT field:

Request to process r1 is made.
dbProcess() checks r1.PACT, finds it false.
r1.process() called:
   r1.PACT = true
   r1 performs I/O etc according to record type,
   calls recGblFwdLink()
   r1.FLNK => r2
   dbProcess() checks r2.PACT, finds it false,
   r2.process() called:
      r2.PACT = true
      r2 performs I/O etc according to record type,
      calls recGblFwdLink()
      r2.FLNK => r1
      dbProcess() checks r1.PACT, finds it true.
      dbProcess() returns
      r2.PACT = false
   r2.process() returns
   r1.PACT = false
r1.process() returns.


However if both records have asynchronous device support, the timeline changes and we can get into a continuous loop, controlled by the speed of the device:


Request to process r1 is made.
dbProcess() checks r1.PACT, finds it false.
r1.process() called:
   r1.PACT = true
   r1 starts I/O operation
r1.process() returns.

r1.device finishes I/O operation,
r1.process() called:
   r1 completes I/O processing
   calls recGblFwdLink()
   r1.FLNK => r2
   dbProcess() checks r2.PACT, finds it false,
   r2.process() called:
      r2.PACT = true
      r2 starts I/O operation
   r2.process() returns
   r1.PACT = false
r1.process() returns.

r2 device finishes I/O operation,
r2.process() is called:
   r2 completes I/O processing
   calls recGblFwdLink()
   r2.FLNK => r1
   dbProcess() checks r1.PACT, finds it false,
   r1.process() called:
      r1.PACT = true
      r1 starts I/O operation
   r1.process() returns.
   r2.PACT = false
r2.process() returns


At this point the IOC will continue to loop between the second and third paragraphs of that description forever, although the time it takes for the I/O operation to complete will control how often it loops.


It is necessary to have two or more asynchronous device supports in a FLNK loop for this situation to occur - with a single asynchronous record processing will always come back to the original record with the PACT field set and thus break the loop. Synchronous records in the loop have no effect on this argument except to increase the stack usage. Note that the infinite loop will not result in a stack overflow, since the two paragraphs can never nest - the lockset locking prevents the I/O completion from happening until after the previous paragraph has come to the end of its work.

- Andrew
--
There is no S in exprexxo.

References:
RE: FLNK loop Chestnut, Ronald P.

Navigate by Date:
Prev: RE: FLNK loop Chestnut, Ronald P.
Next: Wago 750 reliability Eric Williams
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: FLNK loop Chestnut, Ronald P.
Next: Wago 750 reliability Eric Williams
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  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 ·