On Tue, 11 Sep 2012 08:50:33 +0200, andy pugh wrote:
> On 11 September 2012 05:42, EBo <[email protected]> wrote:
>
>> thread #1                      thread #2
>> wait until flag1 unset         some instruction...
>> some instruction...            wait until flag1 unset
>> set flag1                      some instruction...
>> some other instruction...      set flag1
>
> Ah. I hadn't considered the possibility of one thread both waiting 
> on,
> and setting, the same flag.

oh.  I think I misread your prior post then.  I was just trying to 
point out that a context switch can happen (or race condition between 
two cores on a multi-core machine) between the read and set operation.

Programming these types of locks, etc., can be quite tricky.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to