AllenNeuralDynamics / python-newscale

Python library for controlling the micromanipulator systems from New Scale Technologies
MIT License
1 stars 0 forks source link

Thread Safe Implementation for Exotic MultiStage Use-Cases #2

Open Poofjunior opened 2 years ago

Poofjunior commented 2 years ago

Is your feature request related to a problem? Please describe. The current implementation is not thread safe for shared interface across multiple objects. This is unlikely to pose a problem since most real-world implementations are one-python-object-per-interface.

Describe the solution you'd like Consolidate send/read command into a single method at the interface level. Create a ThreadSafeInterface child class of the interface class that wraps this function in a mutex lock. Or, better: do this at the module level so that you can do:

from newscale.thread_safe_interfaces import M3USBInterface