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 2019 2020 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 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: record to record ... |
From: | Ralph Lange <[email protected]> |
To: | EPICS Tech-Talk <[email protected]> |
Date: | Wed, 15 Jul 2015 14:21:49 +0200 |
On 15/07/2015 14:02, Benjamin Franksen wrote:
On Monday 13 July 2015 14:35:49 Kasemir, Kay wrote:In principle, you can read include/link.h to get the 'record' pointer of a link, cast that to the appropriate type, ... But that's a bad idea because you'd directly access the memory of that other record without it being locked.It is possible to do this correctly, using the runtime database access methods: in the init routine you call dbNameToAddr, store the address of the dbAddr struct in the record's DPVT and in the subroutine place calls to dbScanLock/Unlock around a call to dbPutField.
Note, though, that by doing this you are evading the lock-set mechanism, which might get you into trouble - depending on your database configuration.
Records interconnected by links are put into a common lock-set to avoid stack overflow situations with circular links. The described method effectively creates a link that will be undetected by the lock-set forming algorithm. Obviously, disabling safety functions will not affect you in safe situations, but...
Cheers, ~Ralph