HP-UX 11i Version 1.6 Release Notes
Programming
MxN Thread Model
Chapter 7
119
• An application that is not rebuilt on HP-UX 11i v1.6 has all threads created as
PTHREAD_SCOPE_SYSTEM
. If an application is rebuilt on a HP-UX 11i v1.6 system,
threads created by default is
PTHREAD_SCOPE_PROCESS
threads. Applications can
change the default behavior to create
PTHREAD_SCOPE_SYSTEM
threads by compiling
the application with -
DPTHREAD_COMPAT_MODE
.
• Internal helper threads may be created by libpthread and users of pstat_getlwp
and pstat_getproc should be aware of this. In addition, kernel entities used for
scheduling unbound threads may be cached by libpthread and may also show up in
the output of pstat_getlwp and pstat_getproc. Hence an application should not
make any assumptions about the number of kernel entities used by a multi-threaded
process, even if the application is creating only bound threads.
• The behavior of sigstack, sigaltstack and sigspace is undefined when called
from unbound threads. These system calls should be called only from bound threads
for them to work correctly.
•The pthread_pset_bind_np and pthread_launch_policy_np are not supported for
unbound threads.
Compatibility
The behavior of non-POSIX sigstack, sigaltstack and sigspace is undefined when
called from
PTHREAD_SCOPE_PROCESS
threads. These system calls should be called only
from
PTHREAD_SCOPE_SYSTEM
threads for them to work correctly.
Performance
The
PTHREAD_SCOPE_PROCESS
feature of the MxN threads implementation can improve
performance for a subclass of multi-threaded applications. Applications that use very
large number of threads benefit most.
Applications whose threads are computation-bound benefit least. In this case, it is
recommended the application continue to use
PTHREAD_SCOPE_SYSTEM
threads.
Obsolescence
Not applicable.