thr_yield(3thread)


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(3thread), priocntl(2), thr_getscheduler(3thread), thr_getprio(3thread), thr_setprio(3thread), thr_setscheduler(3thread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004