mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 16:32:11 +01:00
17 lines
696 B
TeX
17 lines
696 B
TeX
\pagebreak
|
|
\section{Race Conditions Caused by Implied Copies of Shared Variables in Fortran}
|
|
\fortranspecificstart
|
|
\label{sec:fort_race}
|
|
|
|
The following example contains a race condition, because the shared variable, which
|
|
is an array section, is passed as an actual argument to a routine that has an assumed-size
|
|
array as its dummy argument. The subroutine call passing an array section argument
|
|
may cause the compiler to copy the argument into a temporary location prior to
|
|
the call and copy from the temporary location into the original variable when the
|
|
subroutine returns. This copying would cause races in the \code{parallel} region.
|
|
|
|
\ffreenexample{fort_race}{1}
|
|
\fortranspecificend
|
|
|
|
|