[Omp] OpenMP spec 2.5 seems to have incorrect flush example on page 12

Greg Bronevetsky greg at bronevetsky.com
Mon May 7 14:13:39 PDT 2007


> The point is simply that _unsophisticated_ users should be aware that
> writing code with explicit flushes is difficult to get right.  They
> should understand that they run the risk of implanting complex bugs in
> their code.  And not only that - as we've seen in this thread, they
> should beware of asking the compiler to do aggressive optimizations on
> such code, because sometimes those optimizations may be unsafe in the
> presence of explicit flushes.
> 
   I disagree that explicit flushes are the problem here. We get the same
problem all OpenMP synchronization constructs given this particular
compiler optimization. I think that most OpenMP people would want to
forbid this optimization but I'd like to see some more people give their
thumbs up or down.

                             Greg Bronevetsky





More information about the Omp mailing list