[zeromq-dev] Mac OS X: test_shutdown_stress sometimes fails

Martin Sustrik sustrik at 250bpm.com
Mon Nov 22 10:52:27 CET 2010


On 11/22/2010 09:02 AM, Dhammika Pathirana wrote:

> I'm not sure, does this resolve the race condition?

The idea is:

1. When finalise function finds out that the initiation is over, it 
sends command to itself, saying "unplug the engine and send it to 
another thread".

2. The rest of the out_event executes.

3. The scheduler invokes processing of the event at this point. Thus, 
out_event is not on the stack anymore.

> Engine is not attached to a poller, how do we notify events?

Hard to say. Probably the easiest option would be to process any 
outstanding internal events on the object in a loop until there are no 
more available. Then return control to the scheduler (poller).

Martin



More information about the zeromq-dev mailing list