HP-UX Reference (11i v2 07/12) - 5 Miscellaneous (vol 9)
p
pthread_scope_options(5) pthread_scope_options(5)
force_scope_process
Forces the process scope irrespective of scope specified in the attribute for thread creation.
default_scope_process
If contention scope is set by pthread_attr_setscope()
, that scope is considered while creating a
thread. Otherwise,
PTHREAD_SCOPE_PROCESS
is considered.
default_scope_system
If contention scope is set by pthread_attr_setscope()
, that scope is considered while creating a
thread. Otherwise,
PTHREAD_SCOPE_SYSTEM
is considered.
Note: The properties file options
mxnfromcompatmode
and all1x1 supported on HP-UX 11i v2 will
be supported on HP-UX 11i v2 September 2004 also. However, if any of the above mentioned new proper-
ties file options are used,
mxnfromcompatmode
and
all1x1 will not have any effect.
3. Environmental Variables
There are a set of environment variables which when set can override the scope of the threads specified in
the application. These environment variables should be set before starting the application to run.
The environmental variables supported for controlling the scope are:
PTHREAD_FORCE_SCOPE_SYSTEM
Forces the system scope irrespective of scope specified in the attribute for thread creation.
PTHREAD_FORCE_SCOPE_PROCESS
Forces the process scope irrespective of scope specified in the attribute for thread creation.
PTHREAD_DEFAULT_SCOPE_PROCESS
If contention scope is set by pthread_attr_setscope()
, that scope is considered while creating
a thread. Otherwise,
PTHREAD_SCOPE_PROCESS
is considered.
PTHREAD_DEFAULT_SCOPE_SYSTEM
If contention scope is set by pthread_attr_setscope()
, that scope is considered while creating
a thread. Otherwise,
PTHREAD_SCOPE_SYSTEM
is considered.
Note: PTHREAD_COMPAT_MODE
environment variable that was supported on HP-UX 11i v2 will con-
tinue to be supported on HP-UX 11i v2 September 2004. However, if any of the above mentioned new
environment variables are set,
PTHREAD_COMPAT_MODE
will not have any effect.
Precedence if multiple options are specified:
• Environmental variable settings take higher precedence over properties file settings which in turn take
higher precedence over compile time options.
• If more than one setting is done in one of the ways specified above, force option will take higher pre-
cedence over default option and the scope set by
pthread_attr_setscope()
. System scope takes
more precedence than process scope. The contention scope set by
pthread_attr_setscope()
takes precedence over external scope setting for default scope process and default scope system.
EXAMPLES
1. The following settings are done in properties file:
force_scope_system 1
default_scope_process 1
export PTHREAD_TUNE=1
and
export PTHREAD_PROPERTY_FILE=user’s_properties_file
should be done for the properties file to be read by the pthread library.
If PTHREAD_PROPERTY_FILE is not set, /usr/lib/libpthread.properties
will be used.
With these settings,
force_scope_system will take the precedence, and system scope will be
forced for all thread creations.
2. If the following options are defined at compile time with -D or defined in one of the application header
files: PTHREAD_DEFAULT_SCOPE_SYSTEM and PTHREAD_FORCE_SCOPE_SYSTEM;
PTHREAD_FORCE_SCOPE_SYSTEM will take higher precedence, and system scope threads will be
forced even when pthread_attr_setscope() is used to specify the process scope.
332 Hewlett-Packard Company − 2 − HP-UX 11i Version 2: December 2007 Update