4.2. Using sched_yield and Other Synchronization Mechanisms

The sched_yield system call is used by a thread allowing other threads a chance to run. Often when sched_yield is used, the thread can go to the end of the run queues, taking a long time to be scheduled again, or it can be rescheduled straight away, creating a busy loop on the CPU. The scheduler is better able to determine when and if there are actually other threads wanting to run. Avoid using sched_yield on any RT task.
For more information, see Arnaldo Carvalho de Melo's paper on Earthquaky kernel interfaces.
Related Manual Pages

For more information, or for further reading, the following man pages are related to the information given in this section.

  • pthread.h(P)
  • sched_yield(2)
  • sched_yield(3p)