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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: recordGenerator record |
From: | Dirk Zimoch <[email protected]> |
To: | Andrew Johnson <[email protected]>, Kalantari Babak <[email protected]> |
Cc: | [email protected] |
Date: | Mon, 27 Oct 2008 15:48:00 +0100 |
Unfortunately there are major problems with doing this in a running IOC: we don't have locks in all the database structures that need to be modified when a new record instance is created, which makes this a precarious activity. The current dbStaticLib design assumes that all record creation happens while the IOC is running single-threaded before initialization of any scan or server threads. For example, the pdbbase->ppvd structure which is a hash table of all the record instances has no locks, so one or more server threads could be searching for PV names in the hash bucket linked list that your new record instance gets added to.
Looking at the code in base/src/dbStatic/dbPvdLib.c I can see several ways that simultaneous calls to dbPvdFind() and dbPvdAdd() in different threads could cause a segfault, because this code has not been written with that possibility in mind.
-- Dr. Dirk Zimoch Paul Scherrer Institut, WBGB/006 5232 Villigen PSI, Switzerland Phone +41 56 310 5182