[zeromq-dev] one issue with zeroMQ 2.2.0(PUSH/PULL mode can not work well in multiprocess application(one parent with a number of childs))

Michel Pelletier pelletier.michel at gmail.com
Sat Jun 30 04:42:04 CEST 2012

On Fri, Jun 29, 2012 at 6:46 AM, cleanfield <cleanfield at 126.com> wrote:
> Dear,
> As the guide said, the workers really were running in parallel, if there are
> more than one of them. In my example, the parent process acts as the
> ventilator and sink, a number of its child processes act as worker. The fact
> is that always only one child work in serial.

This is probably because your workers are processing messages faster
than you can PUSH to them, and it appears serial to you.  PUSH is
asynchronous and messages get queued and dealt out round robin to the
workers, who are working in parallel.  There is no synchronization
mechanism that forces them to run serially.  If you push enough
messages that the queue starts to load up, you will see your workers
running in parallel.

Same with the sink, the workers can all PUSH asynchronously in
parallel to the sink, which will queue up the results "fairly" for the
sink to collect.  The only serial parts are the ventilator producing
work and the sink collecting it, the workers all run in parallel.


More information about the zeromq-dev mailing list