EPICS Home

Experimental Physics and Industrial Control System


 
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  <20192020  2021  2022  2023  2024  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Changing record fields while PACT=1
From: "Johnson, Andrew N. via Tech-talk" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Mon, 4 Feb 2019 17:59:50 +0000
Hi Klemen,

On 2/4/19 9:03 AM, Klemen Vodopivec via Tech-talk wrote:
Question is, is PACT=1 enough to ensure exclusive access to record fields? I know record won't process again but is there any EPICS db internals that will poke record while it's being processed?
No, before accessing any record field from your own thread (i.e. from a routine that is not called by an IOC scan thread) you must call dbScanLock(precord) first and dbScanUnlock(precord) afterwards. Other threads such as those belonging to RSRV or QSRV may also want to access your record at the same time — say if someone does a caget/put or a pvget/put these servers don't wait for PACT to be cleared before accessing the fields, but they do take the above lock.

If you have multiple records that you want to update atomically there is also now an API that lets you safely lock a series of records that might belong to different locksets, but the new API is only available in 3.16 or later releases of Base.

HTH,

- Andrew
-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
Re: Changing record fields while PACT=1 Klemen Vodopivec via Tech-talk
References:
Changing record fields while PACT=1 Klemen Vodopivec via Tech-talk

Navigate by Date:
Prev: RE: AsynDriver with delayed and async communication Joao Afonso via Tech-talk
Next: Re: AsynDriver with delayed and async communication Johnson, Andrew N. via Tech-talk
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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Changing record fields while PACT=1 Klemen Vodopivec via Tech-talk
Next: Re: Changing record fields while PACT=1 Klemen Vodopivec via Tech-talk
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  <20192020  2021  2022  2023  2024