Skip to content

Commit ae21a2d

Browse files
author
Vladimir Kotal
committed
mention sched_yield() given it is used in the examples
1 parent 40ddccb commit ae21a2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

threads.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@
243243
\end{slide}
244244

245245
\begin{itemize}
246+
\item Once a thread is created, it is up to the scheduler when the thread
247+
will really start running. The thread can voluntarily give up the CPU by using
248+
\texttt{sched\_yield} (this is POSIX function, unlike \texttt{pthread\_yield}).
246249
\item If the main thread does not wait for the thread to finish, the whole
247250
program will terminate even though there are still some threads running,
248251
see \example{pthreads/pthread\_create.c}

0 commit comments

Comments
 (0)