1YIELD(9)                         Driver Basics                        YIELD(9)
2
3
4

NAME

6       yield - yield the current processor to other threads.
7

SYNOPSIS

9       void __sched yield(void);
10

ARGUMENTS

12       void
13           no arguments
14

DESCRIPTION

16       Do not ever use this function, there's a 99% chance you're doing it
17       wrong.
18
19       The scheduler is at all times free to pick the calling task as the most
20       eligible task to run, if removing the yield call from your code breaks
21       it, its already broken.
22

TYPICAL BROKEN USAGE IS

24       while (!event) yield;
25
26       where one assumes that yield will let 'the other' process run that will
27       make event true. If the current task is a SCHED_FIFO task that will
28       never happen. Never use yield as a progress guarantee!!
29
30       If you want to use yield to wait for something, use wait_event. If you
31       want to use yield to be 'nice' for others, use cond_resched. If you
32       still want to use yield, do not!
33
35Kernel Hackers Manual 3.10         June 2019                          YIELD(9)
Impressum