[zeromq-dev] Socket connect status

Martin Sustrik sustrik at 250bpm.com
Wed Mar 17 17:17:20 CET 2010

Diablo 666 wrote:
> Hi,
>  > The problem is that each end of the queue lives in a different thread.
>  > Writer thread cannot access read end of the queue and vice versa.
> This should not be a problem, I guess. The calling thread can see the
> current write position, so the positions differ after a write.
> Changes in the read positions may be seen with a certain delay, which
> means, that the queue may be empty, but the calling thread sees
> different write and read positions. It can not happen, that the queue
> helds data but the calling thread sees no difference. So this approach
> should be save.

Read position will be sent eventually to the writer thread, but only 
after N messages are passed. So, if you send just 1 message you may 
never get read position.

My impression is that you are taking the hard way. Implementing a sync 
API is matter of few hours. Making existing code work in a sync manner 
is large and tedious task.


More information about the zeromq-dev mailing list