Experimental Physics and
| |||||||||||||||||
|
Hi Bruno, On Fri, May 3, 2019 at 2:44 PM Bruno Martins via Tech-talk <[email protected]> wrote:
There definitely will be challenges when trying to use pyepics from within an IOC or embedded in an application that also uses CA. The assumption that pyepics makes (or "among the assumptions that pyepics makes") is that the process it is running in has not loaded libca/libCom and that pyepics needs to do this. I think it has to be able to connect to the dynamic lib within its own namespace -- I do not know of a way to ask "what dynamic libs are already loaded" from python -- so I sort of doubt that could change. I also think you will absolutely need to specify which libCA to use by setting PYEPICS_LIBCA before initially the epics.ca python module. It sounds like you are doing this, but I doubt that it would work otherwise. Currently, pyepics always calls ca_create_context(). For the "normal" case (not embedded in a process already using CA), that makes sense. We could make that optional, but I'm not sure if "attach_context()" would actually work to find a context created within the main IOC process but not within the embedded python process. That might be worth trying. Are you using Python threads within the embedded Python process? That could cause a complication -- for "normal" usage, it tries to maintain all CA connections in the initial context. There is a flag `ca.AUTO_CLEANUP` that could be set to False to prevent 'ca.finalize_libca()` from being called when exiting the App. I sort of doubt that would actually help, but it's easy enough to try. I have no idea what order of the clean-up steps are done in, or what would happen to connections made to other IOCs. Anyway, the steps of `ca.finalize_libca()` might be broken up into finer-grain steps. --Matt Newville
| ||||||||||||||||
ANJ, 03 May 2019 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |