Skip to content

Conversation

@hatlabcz
Copy link
Contributor

Ported over the code for threaded server that uses the router/dealer ZMQ pattern

  • Server can now handle request from multiple clients concurrently, with a per-instrument lock.
  • Client is changed to the the dealer socket to work with the router socket on the server, but still single threaded.
  • These changes means the following behavior:
    • In a single client process, commands are still always blocking (so instrument calls still run one after another)
    • From different client processes, commands on the same instrument are also blocking . (This is intentional for safety, since not all hardware can safely handle simultaneous commands; calls will still be handled in a queued way as long as timeout is long enough.)
    • From different client process, commands on different instruments can now run fully in parallel.
    • These can be tested with instrumentserver/testing/test_async_requests/demo_concurrency.py

Other changes

  • Changed default unit for timeout from miliseconds to seconds to match with QCoDes
  • Made proxy.Client cache instrument blueprints

…zmq pattern; changed default unit for timeout from miliseconds to seconds

-  also made `proxy.Client` cache instrument blueprints
…nt can only be called from one thread at a time.

- also made a better demo for the usage of threaded server
Copy link
Collaborator

@marcosfrenkel marcosfrenkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks excellent!

@marcosfrenkel marcosfrenkel merged commit 361bddb into toolsforexperiments:master Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants