Ø That
could mean that calling pyepics code from inside a pvaccess callback/notification routine might no longer work if pyepics doesn’t properly set its CA context before calling routines inside libca (unfortunately that’s probably what’s happening, given the access
violation that Mark is seeing).
The pyepics call that it crashing is not happening inside a pvaccess callback/notification routine, it is happening in the following code:
class TomoScan():
…
def __init__(self, pv_files, macros):
…
# Start the watchdog timer thread
thread = threading.Thread(target=self.reset_watchdog, args=(), daemon=True)
thread.start()
…
def reset_watchdog(self):
"""Sets the watchdog timer to 5 every 3 seconds"""
while True:
self.epics_pvs['Watchdog'].put(5)
time.sleep(3)
So the tomoscan constructor is creating a new thread with threading.Thread. That thread is running the simple reset_watchdog function, which simply does an epics.PV.put(5) every 3 seconds. That call crashes with pvaccess 4.0.0 under
the following conditions:
- tomoscan
is built with the functions that include pvaccess
or
- tomoscan
is built without pvaccess but PYEPICS_LIBCA is pointing to the version of ca.dll that comes with pvaccess