OpenMP-Examples/tasking/taskyield.tex
2021-08-17 09:11:55 -07:00

15 lines
531 B
TeX

\pagebreak
\section{\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[3.1]{taskyield}{1}
\ffreeexample[3.1]{taskyield}{1}