SCHED_YIELD(3)

NAME
sched_yield - yield a processor

LIBRARY
libc

SYNOPSIS
#include <sched.h>
int
sched_yield();

DESCRIPTION
sched_yield() yields a processor voluntarily and gives other threads a chance to run without waiting for an involuntary preemptive switch.

RETURN VALUES
On success, sched_yield() returns zero. Otherwise, a value of -1 is returned and errno is set to indicate the error.

SEE ALSO
pthread(3)

CAVEATS
This implementation of sched_yield() gives the processor to threads which belong to the same process. In other words, it's a no-op in a single threaded application.