Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ZMQ sockets in a single thread #838

Open
dimalit opened this issue Jul 1, 2024 · 0 comments
Open

Use ZMQ sockets in a single thread #838

dimalit opened this issue Jul 1, 2024 · 0 comments
Assignees
Milestone

Comments

@dimalit
Copy link
Contributor

dimalit commented Jul 1, 2024

SgxZmqClient::doZmqRequestReply is called from different threads, but according to ZMQ manual, it should not be. this can lead to unpredictable consequences.

Don’t share ZeroMQ sockets between threads. ZeroMQ sockets are not threadsafe. Technically it’s possible to migrate a socket from one thread to another but it demands skill. The only place where it’s remotely sane to share sockets between threads are in language bindings that need to do magic like garbage collection on sockets.

(https://zguide.zeromq.org/docs/chapter2/#Multithreading-with-ZeroMQ)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants