pthread_attr_getdetachstate.3t (2010 09)

p
pthread_attr_getdetachstate(3T) pthread_attr_getdetachstate(3T)
(Pthread Library)
pthread_attr_setschedpolicy()
- set the schedpolicy attribute.
pthread_attr_getschedpolicy()
- get the schedpolicy attribute.
pthread_attr_setschedparam()
- set the schedparam attributes.
pthread_attr_getschedparam()
- get the schedparam attributes.
pthread_attr_setscope()
- set the contentionscope attribute.
pthread_attr_getscope()
- get the contentionscope attribute.
pthread_attr_setprocessor_np()
- set the processor and binding_type attributes.
pthread_attr_getprocessor_np()
- get the processor and binding_type attributes.
The attributes object attr must have previously been initialized with the function
pthread_attr_init()
before these functions are called.
ATTRIBUTE: detachstate
The legal values for the detachstate attribute are:
PTHREAD_CREATE_DETACHED
This option causes all threads created with attr to be in the detached state. The resources
associated with threads having this state are reclaimed automatically by the system when the
threads terminate. Calling the pthread_detach()
or pthread_join()
function for
threads created with this attribute results in an error.
PTHREAD_CREATE_JOINABLE
This option causes all threads created with attr to be in the joinable state. The resources asso-
ciated with threads having this state are not reclaimed when the threads terminate. An appli-
cation must call the pthread_detach()
or pthread_join() functions for threads
created with this attribute to reclaim the system resources.
The default value of detachstate is
PTHREAD_CREATE_JOINABLE
.
pthread_attr_setdetachstate()
is used to set the detachstate attribute in the initialized attri-
butes object attr . The new value of the detachstate attribute is passed to this function in the detachstate
parameter.
pthread_attr_getdetachstate()
retrieves the value of the detachstate attribute from the thread
attributes object attr . This value is returned in the detachstate parameter.
ATTRIBUTE: stacksize
The legal values for the stacksize attribute are:
PTHREAD_STACK_MIN
This option specifies that the size of the user stack for threads created with this attributes
object will be of default stack size. This value is the minimum stack size (in bytes) required for
a thread. This minimum value may not be acceptable for all threads.
stacksize
This defines the size (in bytes) of the user stack for threads created with this attributes object.
This value must be greater than or equal to the minimum stack size
PTHREAD_STACK_MIN.
POSIX.1c does not define a default value. On HP-UX released on PA-RISC platforms, the default value of
the stacksize attribute is 64K, and 256K in HP-UX released on Itanium(R)-based platforms. On Itanium-
based systems, stack is equally divided into memory stack and register stack.
pthread_attr_setstacksize() is used to set the stacksize attribute in the initialized attributes
object attr . The new value of the stacksize attribute is passed to this function in the stacksize parameter.
While modifying the stacksize attribute on Itanium-based platform, user must keep account of memory
stack as well as register stack requirement.
pthread_attr_getstacksize() retrieves the value of the stacksize attribute from the thread attri-
butes object attr . This value is returned in the stacksize parameter.
pthread_attr_setstack() is used to set the stacksize and stackaddr attributes in the initialized
attributes object attr. The new value of the stacksize attribute is passed to this function in stacksize
parameter. The new value of the stackaddr attribute is passed to this function in stackaddr parameter.
Refer to ATTRIBUTE stackaddr for information on stackaddr attribute.
pthread_attr_getstack() retrieves the value of stacksize and stackaddr attributes from the
thread attributes object attr. These values are returned in the stacksize parameter and stackaddr
parameter. Refer to ATTRIBUTE stackaddr for information on stackaddr attribute.
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3