DOKK / manpages / debian 11 / manpages-pl-dev / sched_yield.2.pl
SCHED_YIELD(2) Podręcznik programisty Linuksa SCHED_YIELD(2)

sched_yield - oddanie procesora

#include <sched.h>

int sched_yield(void);

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.

Po pomyślnym zakończeniu sched_yield() zwraca zero. Po błędzie zwracane jest -1 i odpowiednio ustawiane errno.

In the Linux implementation, sched_yield() always succeeds.

POSIX.1-2001, POSIX.1-2008.

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 sched_yield().

Systemy POSIX-owe, na których dostępny jest sched_yield() definiują w <unistd.h> _POSIX_PRIORITY_SCHEDULING.

Strategic calls to sched_yield() can improve performance by giving other threads or processes a chance to run when (heavily) contended resources (e.g., mutexes) have been released by the caller. Avoid calling 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.

sched_yield() is intended for use with real-time scheduling policies (i.e., SCHED_FIFO or SCHED_RR). Use of sched_yield() with nondeterministic scheduling policies such as SCHED_OTHER is unspecified and very likely means your application design is broken.

sched(7)

Angielska wersja tej strony pochodzi z wydania 5.10 projektu Linux man-pages. Opis projektu, informacje dotyczące zgłaszania błędów oraz najnowszą wersję oryginału można znaleźć pod adresem https://www.kernel.org/doc/man-pages/.

Autorami polskiego tłumaczenia niniejszej strony podręcznika są: Przemek Borys <pborys@dione.ids.pl>

Niniejsze tłumaczenie jest wolną dokumentacją. Bliższe informacje o warunkach licencji można uzyskać zapoznając się z GNU General Public License w wersji 3 lub nowszej. Nie przyjmuje się ŻADNEJ ODPOWIEDZIALNOŚCI.

Błędy w tłumaczeniu strony podręcznika prosimy zgłaszać na adres manpages-pl-list@lists.sourceforge.net.

15 września 2017 r. Linux