[zeromq-dev] Inter thread communication for scalability

Goswin von Brederlow goswin-v-b at web.de
Fri Jan 17 11:35:38 CET 2014


On Thu, Jan 16, 2014 at 09:11:48PM -0600, Kenneth Adam Miller wrote:
> On Wed, Jan 15, 2014 at 8:36 AM, Goswin von Brederlow <goswin-v-b at web.de>wrote:
> > All those threads get confusing. Lets draw a picture:
> >
> >    +--------------------------------------------------------------------+
> >    |                                                                    |
> >    v                                                                    |
> >  Pool A          Thread Set 1         Router X                          |
> > PULL-PUSH --==> PULL-read-PUSH ==--> PULL-PUSH --==> PULL Thread Set 2 PUSH
> >                                                          \            /
> >                                                           +-compress-+
> >                                       Pool B             /            \
> >                                      PULL-PUSH --==> PULL              PUSH
> >                                       ^                                 ||
> >                                       |                                 ||
> >                                       +----------- PUSH-write-PULL <--==++
> >                                                       Thread 3
> >
> >
> So, I believe this is pretty close, but if I'm right, but you created a
> router to deal with a N-M situation, when in actuality a slightly different
> configuration is needed in order to make that work. I could be
> understanding this wrong, but after I looked at the examples some more, I
> think things started to finally click. I think the multi-threaded example
> given in the manual that used a router and a dealer required that the
> sockets be of type REQ and REP in order to work. I don't think that PUSH
> and PULL is, at least not according to the reference guide on zmq_socket.
> Is that correct? I'm pretty sure that the only thing that you got wrong is
> to illustrate that router takes requests in from thread set 1 and shuttles
> them out to thread set 2 as replies.

I just called the thread router because it routes messages from Thread
Set 1 to Thread Set 2. I didn't use a ROUTER/DEALER  socket for it as
I believe the guide has for its router example.

But that is because the other endpoints are PUSH and PULL so messages
go strictly one way and I only need PULL and PUSH to complement them
in the router thread. On the other hand I'm fairly new to zmq, too. So
I could be wrong.

MfG
	Goswin



More information about the zeromq-dev mailing list