Dear list,

I am very new to zmq and noticed in
http://zguide.zeromq.org/page:all#Multithreading-with-MQ that it seems to
be a good idea to replace mutex with message passing in zmq.

But my question is that how should I exactly transform from the notion of
mutex, conditional variable and etc to the thinking pattern of zmq.

Here is an example I encountered:

I have thread A, B, C. They will all modify state S. In the past, I will do
lock on this shared state and they can coordinate, but I don't know how to
express the mutex semantic using zmq. One way I think of is that I create
another thread D and let A,B,C communicate with D over zmq when they want
to manipulate S, and there will be no race condition since D is
coordinating everything. But I feel that this is definitely not the best
practice...

So could you inform me what is it and why it is worthwhile to use zmq
instead of mutex

Sorry if this question is naiive, still trying to figure things out.

Thank you very much
-Mo
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to