sched_yield
(2)yield the processor
#include <sched.h> int sched_yield(void);
LIBRARY
DESCRIPTION
RETURN VALUE
ERRORS
STANDARDS
HISTORY
CAVEATS
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.
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().
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.