SCHED_YIELD(3P)
π SCHED_YIELD(3P) π
okay bestie, so this is a page from the POSIX Programmer's Manual (that's the manual, right there in the name π), and before we even get into it you gotta know something, okay?
PROLOG β This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
like. read that again. the Linux version might be doing its own little thing, so if you're on Linux, go check the Linux manpage too. no cap. π
β¨ NAME β¨
sched_yield β yield the processor
it's giving "ma'am, it's not your turn anymore" π
πΈ SYNOPSIS πΈ
#include <sched.h>
int sched_yield(void);
π¦ DESCRIPTION π¦
okay so sched_yield() is literally the politest function in the whole scheduler. The sched_yield() function shall force the running thread to relinquish the processor until it again becomes the head of its thread list.
and the way that it takes no arguments? iconic. zero args. it just walks up, says "you know what, someone else can go," and steps aside. queen behavior honestly π
π RETURN VALUE π
The sched_yield() function shall return 0 if it completes successfully; otherwise, it shall return a value of -1 and set errno to indicate the error.
so 0 = slay, -1 = uh oh check errno bestie π
π ERRORS π
No errors are defined.
yup. that's it. nothing. the error section is empty like my calendar on a Friday night π
The following sections are informative.
π EXAMPLES π
None.
not a single one. the examples section said "no thoughts, head empty" π§
π APPLICATION USAGE π
okay this part is the real tea, so listen up π«Ά
The conceptual model for scheduling semantics in POSIX.1β2008 defines a set of thread lists. This set of thread lists is always present regardless of the scheduling options supported by the system.
and here's the important bit for your portable code: On a system where the Process Scheduling option is not supported, portable applications should not make any assumptions regarding whether threads from other processes will be on the same thread list.
tl;dr β if the system doesn't support the Process Scheduling option, do not assume anything about whose threads are chillin' on the same thread list. assume nothing. that's the vibe check. π
π RATIONALE π
None.
nope. nothing here. moving on bestie π
β FUTURE DIRECTIONS β
None.
the future is... also empty. periodt.
π₯ SEE ALSO π₯
- The Base Definitions volume of POSIX.1β2017,
<sched.h>
go read the header, iykyk π
π COPYRIGHT π
okay this is the legal bit, and we do NOT skip the legal bit, bestie, we read it with respect π«Ά
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! πβ¨ this one came to you from IEEE/The Open Group, 2017 β that's the source and the date right there β and it's the SCHED_YIELD(3P) page, so now you know exactly how to be the most gracious thread in the whole thread list π bye ily π«Ά
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms