OpenMP-Examples/Examples_taskyield.tex

15 lines
525 B
TeX

\pagebreak
\section{The \code{taskyield} Construct}
\label{sec:taskyield}
The following example illustrates the use of the \code{taskyield} directive.
The tasks in the example compute something useful and then do some computation
that must be done in a critical region. By using \code{taskyield} when a task
cannot get access to the \code{critical} region the implementation can suspend
the current task and schedule some other task that can do something useful.
\cexample{taskyield}{1}
\ffreeexample{taskyield}{1}