DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

thr_yield(THREAD)


thr_yield -- yield the processor

Synopsis

   cc [options] -Kthread file
   

#include <thread.h>

void thr_yield(void);

Description

thr_yield() causes the calling thread to stop executing to allow another eligible thread (if any) to run. The calling thread will remain in a runnable state.

In this implementation, a multiplexed thread calling thr_yield will yield its lightweight process (LWP) only if another thread of higher or equal priority is runnable. In that case, the calling thread will be halted and it will be placed on the end of its priority queue. If only lower priority threads are runnable, or no other thread is runnable, the caller will continue executing. Likewise, a bound thread calling thr_yield will cause its LWP to yield the processor if another thread of higher or equal priority is runnable.

This function should be viewed as a hint from the caller to the system, indicating that the caller has reached a point at which it is convenient to yield the processor to other threads.

thr_yield requires no special permissions or privilege.

Usage

thr_yield() is used by multithreaded applications which need to control their scheduling.

Return values

None

Errors

None.

References

Intro(THREAD), priocntl(S), thr_getscheduler(THREAD), thr_getprio(THREAD), thr_setprio(THREAD), thr_setscheduler(THREAD)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005