[zeromq-dev] weird block

Andrew Hume andrew at research.att.com
Tue Apr 26 16:44:23 CEST 2011


really?
a poll on the send_msg?

it makes sense but it surely screws up my logic flow.

god i hate distributed programming.

On Apr 26, 2011, at 7:29 AM, Martin Sustrik wrote:

> On 04/26/2011 04:22 PM, Andrew Hume wrote:
>> god i hate distributed programming!
> 
> :)
> 
>> i have a program X receiving messages.
>> it forwards those messages out to a set of worker processes for processing.
>> X sends out the messages via a PUSH; the workers PULL the messages.
>> i set the high water mark on the PUSH socket in X.
>> 
>> so my controller program broadcasts out a 'quit' message to everyone
>> and all of X's workers quit. now X also got a 'quit' message but now
>> it never sees it because it is blocked in teh send of the messages it has.
>> and that queue will never unblock because now there are no workers
>> to eat from teh queue (which would allow the send to finish
>> and thus get back to the poll where it could see the quit message).
>> 
>> is there a recommended way around this?
> 
> I assume you are distributing the 'quit' command using a PUB/SUB 
> topology, right?
> 
> If so, just poll on both the PUSH and SUB socket. The poll exits either 
> if PUSH is available for writing or if there's a 'quit' message 
> available in SUB socket.
> 
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev


------------------
Andrew Hume  (best -> Telework) +1 623-551-2845
andrew at research.att.com  (Work) +1 973-236-2014
AT&T Labs - Research; member of USENIX and LOPSA




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


More information about the zeromq-dev mailing list