From 399644e47874bff147afb19c89228901ac39340e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:40:15 +0200 Subject: Adding upstream version 6.05.01. Signed-off-by: Daniel Baumann --- man2/sched_yield.2 | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 man2/sched_yield.2 (limited to 'man2/sched_yield.2') diff --git a/man2/sched_yield.2 b/man2/sched_yield.2 new file mode 100644 index 0000000..154fd4f --- /dev/null +++ b/man2/sched_yield.2 @@ -0,0 +1,76 @@ +.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 +.\" +.\" SPDX-License-Identifier: GPL-2.0-or-later +.\" +.\" 1996-04-01 Tom Bjorkholm +.\" First version written +.\" 1996-04-10 Markus Kuhn +.\" revision +.\" +.TH sched_yield 2 2023-05-03 "Linux man-pages 6.05.01" +.SH NAME +sched_yield \- yield the processor +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.B #include +.PP +.B int sched_yield(void); +.fi +.SH DESCRIPTION +.BR sched_yield () +causes the calling thread to relinquish the CPU. +The thread is moved to the end of the queue for its static +priority and a new thread gets to run. +.SH RETURN VALUE +On success, +.BR sched_yield () +returns 0. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +In the Linux implementation, +.BR sched_yield () +always succeeds. +.SH STANDARDS +POSIX.1-2008. +.SH HISTORY +POSIX.1-2001 (but optional). +POSIX.1-2008. +.PP +Before POSIX.1-2008, +systems on which +.BR sched_yield () +is available defined +.B _POSIX_PRIORITY_SCHEDULING +in +.IR . +.SH CAVEATS +.BR sched_yield () +is intended for use with real-time scheduling policies (i.e., +.B SCHED_FIFO +or +.BR SCHED_RR ). +Use of +.BR sched_yield () +with nondeterministic scheduling policies such as +.B SCHED_OTHER +is unspecified and very likely means your application design is broken. +.PP +If the calling thread is the only thread in the highest +priority list at that time, +it will continue to run after a call to +.BR sched_yield (). +.PP +Avoid calling +.BR sched_yield () +unnecessarily or inappropriately +(e.g., when resources needed by other +schedulable threads are still held by the caller), +since doing so will result in unnecessary context switches, +which will degrade system performance. +.SH SEE ALSO +.BR sched (7) -- cgit v1.2.3