sched_yield(3pthread)


sched_yield -- yield the processor

Synopsis

   cc [options] -Kthread file
   

#include <sched.h>

int sched_yield(void);

Description

sched_yield causes the calling thread to stop executing to allow another eligible thread of higher or equal priority (if any) to run. The calling thread will remain in a runnable state. sched_yield forces the running thread to relinquish the processor until it again becomes the head of its thread list. It takes no arguments.

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.

sched_yield requires no special permissions or privilege.

Return values

None. The sched_yield function always returns 0.

Diagnostics

None.

Standards Compliance

The Single UNIX Specification, Version 2; The Open Group.

References

Intro(3pthread), priocntl(2), pthread_getschedparam(3pthread), pthread_setschedparam(3pthread), sched(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004