Race Conditions/1
- In the following code the result varies unpredictably based on detailed order of execution of each section
-
-
-
- wrong answers produced without warning
- fixing the example, we choose the assignments to occur in order A, B, C
- icount forces this order
- FLUSH forces the update of the shared variable
c$omp end parallel sections
if(icount.lt.1) goto 1000
if(icount.lt.2) goto 2000
c$omp end parallel sections