SCHED_YIELD(2)

NAME
sched_yield - yield the processor

SYNOPSIS
# include <sched.h>

int sched_yield ( void )

DESCRIPTION
The function sched_yield causes the calling process to give up the CPU and move to the end of the scheduling queue for its priority.

RETURN VALUE
On a system supporting the POSIX.4 real-time scheduler, this call will always return 0.

NOTES
For processes being scheduled uning POSIX.4 SCHED_RR scheduling policy, sched_yield will reset the time quantum the full amount for the process, rather than leaving the decayed remnant intact. This is not a POSIX.4 behavior but it seems reasonable.

Under Linux, SCHED_OTHER scheduling policy processes, (ie., the default Linux timeshare scheduler) which call sched_yield will lose any remaining ticks available to effect a yield operation to any other runnable process.

SEE ALSO
sched_setscheduler(2), sched_getscheduler(2), sched_setparam(2), sched_getparam(2)