[Omp] Waiting on a condition variable

Greg Bronevetsky greg at bronevetsky.com
Fri Jan 19 08:30:19 PST 2007


> All you can basically do is busy-wait, i.e. spin in a loop until your 
> condition becomes true.
> 
   Its actually a little worse than that. The memory model is loose enough
that the only thing you can legally do is spin-wait for one or more
variables to change. You can't actually rely on the value you read in a
spin-loop, regardless of how many flushes you put in there. You are
allowed to spin on a condition if you read from and write to the variables
in question inside critical sections or locked regions. However, this is
not much of a replacement for condition variables.

                             Greg Bronevetsky



More information about the Omp mailing list