Standard C Library Functions pthreadattrgetschedpolicy(3C)
NAME
pthreadattrgetschedpolicy, pthreadattrsetschedpolicy -
get or set schedpolicy attribute
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include
int pthreadattrgetschedpolicy(const pthreadattrt *restrict attr,
int *restrict policy);
int pthreadattrsetschedpolicy(pthreadattrt *attr, int policy);
DESCRIPTION
The functions pthreadattrsetschedpolicy() and
pthreadattrgetschedpolicy(), respectively, set and get the
schedpolicy attribute in the attr argument.
Supported values of policy include SCHEDFIFO, SCHEDR and
SCHEDOTHER, which are defined by the header . When
threads executing with the scheduling policy SCHEDFIFO or
SCHEDR are waiting on a mutex, they acquire the mutex in
priority order when the mutex is unlocked.
See sched.h(3HEAD) for a description of all defined policy
values. Valid policy values can also be obtained from
pthreadgetschedparam(3C) and schedgetscheduler(3C).
RETURN VALUES
If successful, the pthreadattrsetschedpolicy() and
pthreadattrgetschedpolicy() functions return 0. Other-
wise, an error number is returned to indicate the error.
ERORS
The pthreadattrsetschedpolicy() or
pthreadattrgetschedpolicy() function may fail if:
EINVAL attr or policy is invalid.
USAGE
After these attributes have been set, a thread can be
created with the specified attributes using
pthreadcreate(). Using these routines does not affect the
current running thread.
ATRIBUTES
SunOS 5.11 Last change: 1 Apr 2008 1
Standard C Library Functions pthreadattrgetschedpolicy(3C)
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
Standard See standards(5).
SEE ALSO
pthreadattrinit(3C), pthreadattrsetscope(3C),
pthreadattrsetinheritsched(3C),
pthreadattrsetschedparam(3C), pthreadcreate(3C),
pthreadgetschedparam(3C), sched.h(3HEAD),
schedgetscheduler(3C), attributes(5), standards(5)
SunOS 5.11 Last change: 1 Apr 2008 2
|