[nanomsg] Re: Ordering of inproc messages with pipeline.

  • From: Timothee Besset <ttimo@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Fri, 25 Jul 2014 21:33:34 -0500

No the problem isn't specific to pub/sub. It just happens if messages pile
in too fast. At least on Windows.

TTimo


On Fri, Jul 25, 2014 at 9:02 PM, Soren Riise <sorenriise@xxxxxxxxxxx> wrote:

> That is a good question -- Im not 100% positive, but it is worth checking
> out.
>
> The case you are referring to looks like being PUB-SUB and I can
> understand how slow joiners may not get all messages, but im not sure how
> that would the case for pipeline operations.
>
> Soren
>
>
>   ------------------------------
>  *From:* Timothee Besset <ttimo@xxxxxxxxx>
> *To:* nanomsg@xxxxxxxxxxxxx
> *Sent:* Friday, July 25, 2014 4:45 PM
> *Subject:* [nanomsg] Re: Ordering of inproc messages with pipeline.
>
> Are you positive that it's a reordering of messages, and not just dropped
> messages as in https://github.com/nanomsg/nanomsg/issues/283 ?
>
>
>
>
> On Fri, Jul 25, 2014 at 5:17 PM, Soren Riise <sorenriise@xxxxxxxxxxx>
> wrote:
>
> Im seeing inproc messages being delivered in a different order than they
> are sent, and was wondering if this is a feature or a bug.
>
> Using a git-cloned version 0.4, im having two threads pipeline data, as
> (psudocode)
>
>      nn_connect( sock = nn_socket(AF_SP, NN_PUSH), "inproc://abc")
>      while (data = moredata()) {
>             void *buf = nn_allocmsg(data.size(),0);
>             memcpy(buf, data.c_str(), data.size());
>             nn_send(sock, &buf, NN_MSG, 0);
>     }
>     void *buf = nn_allocmsg(1,0);
>     buf.eof = true;
>     nn_send(sock, &buf, NN_MSG, 0);
>
> and the reciver;
>
>      nn_bind( sock = nn_socket(AF_SP, NN_PULL), "inproc://abc")
>      while (nn_recv(sock, &buf, NN_MSG,0) != -1) {
>             if (buf.eof == true)
>                   break;
>             nn_freemsg(buf);
>     }
>
>
> However I see that messages are arriving in a different order than they
> were sent, I basically see the EOF message which should be last being the
> first message received -- if that is expected behavior it would warrant at
> least a line of explanation in the documentation.
>
> Should I implement the pipeline in a different way if the ordering of data
> is important?
>
>
> Soren
>
>
>
>
>

Other related posts: