[zeromq-dev] Issue 85 & 92

Martin Sustrik sustrik at 250bpm.com
Sat Oct 16 19:25:21 CEST 2010


On 10/16/2010 07:14 PM, Pieter Hintjens wrote:
> On Sat, Oct 16, 2010 at 5:18 PM, Martin Sustrik<sustrik at 250bpm.com>  wrote:
>
>    
>>     //  directly modify sock's data from this thread
>>     sock->some_variable = some_value;
>>    //  crash!
>>      
> Not if you use atomics, which is all you need for a flag saying "this
> socket has been terminated, please do not allow further operations on
> it".  It's fast and safe. You need to set and check one single bit.
>    
Ack. This means putting atomic op on the critical path (zmq_send) 
resulting in grave performance impact.

>> Almost all language runtimes do migrate sockets. Thus you have say 80%
>> programs affected.
>>      
> How did this work pre-2.1?  I was under the impression the only
> language binding that had problems with this was Erlang.
>    
The reason for this is that Erlang does a lot of migration while other 
VMs are pretty decent about it.

Thus it more or less worked so far. To encounter the problem you had to 
have a multicore box, the VM had to migrate the socket to a different 
core etc. Moreover, the migration was mostly done in shutdown phase 
where the failure was kind of benign till now. Now that we are doing 
business logic on shutdown (sending pending messages) the failure during 
shutdown is much more of a problem.

In short, it's is a long-known problem that have been finally being 
fixed in 2.1

Martin



More information about the zeromq-dev mailing list