You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to take some of the points that I brought up in the daq-dev channel / dev call and put them here so its easier to find.
Most agents that we write are accessing a single piece of hardware, using a driver module that is not thread-safe. Because OCS operations are by default multi-threaded, this means we have to be very careful about concurrent usage, with the use of TimeoutLocks and release_and_acquire for long-running processes, which may cause issues if lock timeouts are reached.
A safer way to design such agents is to have a single operation, such as main that is responsible for the driver, and then messages are passed between various agent tasks to the main operation via a thread-safe queue that request specific actions be performed on the hardware. Right now there are no simple agent that use this structure, but this PR shows how the Lakeshore 240 agent might be structured in such a way.
I think we should try an design agents this way moving forward, and transition agents that are experiencing locking issues to this structure as needed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I wanted to take some of the points that I brought up in the daq-dev channel / dev call and put them here so its easier to find.
Most agents that we write are accessing a single piece of hardware, using a driver module that is not thread-safe. Because OCS operations are by default multi-threaded, this means we have to be very careful about concurrent usage, with the use of
TimeoutLocks
andrelease_and_acquire
for long-running processes, which may cause issues if lock timeouts are reached.A safer way to design such agents is to have a single operation, such as
main
that is responsible for the driver, and then messages are passed between various agent tasks to the main operation via a thread-safe queue that request specific actions be performed on the hardware. Right now there are no simple agent that use this structure, but this PR shows how the Lakeshore 240 agent might be structured in such a way.I think we should try an design agents this way moving forward, and transition agents that are experiencing locking issues to this structure as needed.
Beta Was this translation helpful? Give feedback.
All reactions