Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Add omni_thread::ensure_self to AutoPythonAllowThreads #318

Closed
wants to merge 1 commit into from

Conversation

ajoubertza
Copy link
Member

This is to fix issues with multi-threaded applications, when using "standard" threads, i.e. not omnithreads. Typical failures occur when using DeviceProxy objects created in different threads that subscribe to events.

The cppTango layer assumes threads are omnithreads, and some of its checks rely on them having an omnithread ID. This ensure_self object creates a dummy ID.

The AutoPythonAllowThreads class is a guard used to release the GIL and protects all (most?) network I/O via the cppTango layer. An ensure_self object will now exist for the lifetime of each guard as well.

Closes issue #307
Closes issue #292

(Does not help with issue #315)

This is to fix issues with multi-threaded applications, when using
"standard" threads, i.e. not omnithreads.  Typical failures occur
when using `DeviceProxy` objects created in different threads that
subscribe to events.

The cppTango layer assumes threads are omnithreads, and some of its
checks rely on them having an omnithread ID.  This `ensure_self`
object creates a dummy ID.

The `AutoPythonAllowThreads` class is a guard used to release the
GIL and protects all (most?) network I/O via the cppTango layer.
An `ensure_self` object will now exist for the lifetime of each
guard as well.
@reszelaz
Copy link
Contributor

This is just to let you know that I'm testing this PR as well as solution proposed by Michal in #292. Soon I will post more information.

@ajoubertza
Copy link
Member Author

Closing this in favour of #327 - that is a safer solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants