Unlike CPSlib, pthreads does not use
environment variables to establish thread attributes. pthreads
implements function calls to achieve the same results. However,
when using the HP compiler set, the environment variables below
must be set to define attributes.
The table below describes the environment variables and how
pthreads handles the same or similar tasks.
The environment variables below must be set for use with the
HP compilers if you are not explicitly using pthreads.
Table A-2 CPSlib environment
variables
| Environment variable | Description | How handled by pthreads |
|---|
| MP_NUMBER_OF_THREADS | Sets the number of threads that the compiler
allocates at startup time. | By default, under HP-UX you can
create more threads than you have processors for. |
| MP_IDLE_THREADS_WAIT | Indicates how
idle compiler threads should wait. | The values can be: -1 -
spin wait; 0 -
suspend wait; N -
spin suspend where N > 0. |
| CPS_STACK_SIZE | Tells the compiler what size stack to allocate
for all it's child threads. The default stacksize is 80
Mbyte. | Pthreads allow you to set the stack size
using attributes. The attribute call is pthread_attr_setstacksize. The
value of CPS_STACK_SIZE is specified
in Kbytes. |