pthread_attr_setscope(3pthread)


pthread_attr_setscope, pthread_attr_getscope -- set and get contentionscope attribute

Synopsis

cc [options] -Kthread file

#include <pthread.h>

int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope); int pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope);

Description

pthread_attr_setscope and pthread_attr_getscope are used to set and get the contentionscope attribute in the attr object.

contentionscope may have the values PTHREAD_SCOPE_SYSTEM, signifying system scheduling contention scope, or PTHREAD_SCOPE_PROCESS, signifying process scheduling contention scope. The symbols PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS are defined by the header pthread.h

Usage

After these attributes have been set, a thread can be created with the specified attributes using pthread_create(3pthread). Using these routines does not affect the current running thread.

Return values

If successful, pthread_attr_setscope and pthread_attr_getscope return zero. Otherwise, an error number is returned to indicate the error.

Diagnostics

If the following condition is detected, pthread_attr_setscope and pthread_attr_getscope will return the corresponding value:

EINVAL
invalid attribute

If the follwing condition is detected, pthread_attr_setscope will return the corresponding value:


ENOTSUP
attempt to set the attribute to an unsupported value

References

pthread_attr_init(3pthread), pthread_attr_setinheritsched(3pthread), pthread_attr_setschedpolicy(3pthread), pthread_attr_setschedparam(3pthread), pthread_create(3pthread), pthread_setschedparam(3pthread), pthread(4), sched(4)

Standards compliance

The Single UNIX Specification, Version 2; The Open Group.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004