pthread_attr_setscope()

set scheduling scope attribute 

Function


SYNOPSIS

#include <pthread.h>

int pthread_attr_setscope(pthread_attr_t *attr, int scope);


DESCRIPTION

The pthread_attr_setscope() function sets the scheduling scope attribute in the specified attribute object. The thread's scheduling scope attribute determines whether thread-scheduling decisions apply to threads in a given process, or system-wide to all threads. Valid settings for scope include:

PTHREAD_SCOPE_PROCESS  

Threads are scheduled with respect to other threads in the current process.

PTHREAD_SCOPE_SYSTEM  

Threads are scheduled with respect to all threads in the system.

The specified scheduling scope is only used if the scheduling parameter inheritance attribute is PTHREAD_EXPLICIT_SCHED.


PARAMETERS

attr 

Is the thread attribute object.

scope 

Is the thread scheduling scope attribute value; one of the values specified in the DESCRIPTION section.


RETURN VALUES

On success, pthread_attr_setscope() returns 0. On error, one of the following values is returned.

EINVAL 

attr is not an initialized thread attribute object, or scope does not specify a valid scheduling scope setting.

EFAULT 

attr is an invalid pointer.

ENOTSUP 

scope was set to PTHREAD_SCOPE_PROCESS.


CONFORMANCE

POSIX P1003.1 (1996)


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

The PTHREAD_SCOPE_PROCESS scheduling scope is not currently supported; if this value is specified, the function returns ENOTSUP.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
pthread_attr_getscope(), pthread_attr_init(), pthread_attr_setinheritsched(), pthread_create()


PTC MKS Toolkit 10.3 Documentation Build 39.