pthread_yield.3t (2010 09)
p
pthread_yield(3T) pthread_yield(3T)
(Pthread Library)
NAME
pthread_yield() - notify the scheduler that the current thread is willing to relinquish the use of its proces-
sor
SYNOPSIS
#include <pthread.h>
int pthread_yield(void);
PARAMETERS
None.
DESCRIPTION
The
pthread_yield()
function notifies the scheduler that the current thread is willing to relinquish
the use of its processor to other threads of equivalent or higher priority. If the run queue is empty or if
no other threads of equivalent or greater scheduling priority are ready to execute when the
pthread_yield()
function is called, then the calling thread is immediately rescheduled.
If the calling thread has the system contention scope (
PTHREAD_SCOPE_SYSTEM
), then calling this
function notifies the kernel scheduler.
If the calling thread has the process contention scope (
PTHREAD_SCOPE_PROCESS
), then calling this
function notifies the user space scheduler.
RETURN VALUE
Upon successful completion,
pthread_yield()
returns zero.
ERRORS
None.
AUTHOR
pthread_yield() was developed by HP.
SEE ALSO
rtsched(2), rtprio(2), pthread_attr_setscope(3T), pthread_setschedparam(3T).
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1