MRocklin
MRocklin

Reputation: 57271

Is polling on a ZMQ router socket threadsafe?

I have multiple threads interacting with the same ZeroMQ router socket (bad idea, I know). I manage thread safety with locks on all sends and receives.

Do I also need to lock polling or is this relatively benign operation threadsafe?

Upvotes: 0

Views: 262

Answers (1)

thunder
thunder

Reputation: 521

I think using polling alleviates any need for multithreading. You can pick up events as they come in using the poll loop on one thread and then distribute those events if you wish to other threads for processing. This way you don't need to share the socket.

Upvotes: 1

Related Questions