OpenMP-Examples/tasking/taskyield.tex
2024-04-16 08:59:23 -07:00

17 lines
637 B
TeX

\pagebreak
\section{\kcode{taskyield} Construct}
\label{sec:taskyield}
\index{constructs!taskyield@\kcode{taskyield}}
\index{taskyield construct@\kcode{taskyield} construct}
The following example illustrates the use of the \kcode{taskyield} construct.
The tasks in the example compute something useful and then do some computation
that must be done in a critical region. By using \kcode{taskyield} when a task
cannot get access to the \kcode{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}