[zeromq-dev] [2.1.0] encoder hanging in remote_thr tests

Steven McCoy steven.mccoy at miru.hk
Thu Dec 2 07:24:25 CET 2010

On 2 December 2010 14:14, Steven McCoy <steven.mccoy at miru.hk> wrote:

> Disable optimisation for encoder.cpp and it works as expected.
Alternative is a memory barrier before the re-init of in_progress.

bool zmq::encoder_t::message_ready ()
LONG volatile target = 0;
    //  Destroy content of the old message.
    zmq_msg_close (&in_progress);

    //  Read new message. If there is none, return false.
    //  Note that new state is set only if write is successful. That way
    //  unsuccessful write will cause retry on the next state machine
    //  invocation.
    if (!source || !source->read (&in_progress)) {
InterlockedExchange (&target, 1);
        zmq_msg_init (&in_progress);
//puts ("no new message");
        return false;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101202/58366722/attachment.htm>

More information about the zeromq-dev mailing list