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

Martin Sustrik sustrik at 250bpm.com
Mon Dec 6 13:53:35 CET 2010


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...

Martin



More information about the zeromq-dev mailing list