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