[zeromq-dev] [PATCH][Issue 137] Two alternative patches to resolve MSVC optimisation issue

Steven McCoy steven.mccoy at miru.hk
Mon Dec 6 14:14:26 CET 2010


On 6 December 2010 20:53, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Steven,
>
>  Interesting the _ReadWriteBarrier() intrinsic does not work even though
>> that is what it is designed for.  I manually add a memory fence using a
>> locking intrinsic or just disable optimisation of the entire function.
>>  For high performance of TCP it is probably better to go with adding
>> the intrinsic.
>>
>> To reproduce just run the following a few times and see if it locks,
>>
>> remote_thr.exe "epgm://10.6.28.35 <http://10.6.28.35>;239.192.0.1:7500
>> <http://239.192.0.1:7500>" 10 10
>>
>>
>> Patches are not signed because there are two options, therefore I
>> explicitly state these patches are released under the MIT/X11 license.
>>
>
> Something strange is going on here.
>
> If the compiler optimises out source->read() the second patch would not
> work.
>
> Assuming that it actually helps, I would say it's rather a timing issue or
> somesuch...
>
>
I've tested, both work.  Feel free to find other workarounds.

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101206/3c4ba619/attachment.htm>


More information about the zeromq-dev mailing list