On Friday, February 28, 2014 6:56:31 PM UTC-8, Chris M. Thomasson wrote:
>
>
>
> On Friday, February 28, 2014 1:57:24 PM UTC-8, Chris M. Thomasson wrote:
>>
>> > [...] 
>>
>>> > I accidentally replied to author. Sorry about that! ;^(
>>>
>>> > [...]
>>
> > 
> > [...]
> > http://software.intel.com/en-us/forums/topic/295834<http://www.google.com/url?q=http%3A%2F%2Fsoftware.intel.com%2Fen-us%2Fforums%2Ftopic%2F295834&sa=D&sntz=1&usg=AFQjCNEYjs-FCDKO3kxX48qA4XJZuU5exQ>
> > (a non-distributed eventcount by me)
>

I need to point out that the code in C++ is correct, however, the C# link 
has a race-condition in the following function:


   1. public void signal() {
   2.       long cmp = System.Threading.Thread.VolatileRead(ref m_count);
   3.       System.Threading.Thread.MemoryBarrier();
   4.       prv_signal(cmp, false);
   5.     }
   

The memory barrier needs to be _before_ the load of m_count!!!!

:^o
 

>
>
>  
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Scalable Synchronization Algorithms" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lock-free/6af873f5-5110-45f3-9eb2-453ab2d7ed65%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to