pthread_attr_getdetachstate man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



pthread_attr_init(3P)					 pthread_attr_init(3P)

NAME
     pthread_attr_init, pthread_attr_destroy, pthread_attr_setstacksize,
     pthread_attr_getstacksize, pthread_attr_setstackaddr,
     pthread_attr_getstackaddr, pthread_attr_setdetachstate,
     pthread_attr_getdetachstate - initialize thread attributes

C SYNOPSIS
     #include <pthread.h>

     int pthread_attr_init(pthread_attr_t *attr);
     int pthread_attr_destroy(pthread_attr_t *attr);
     int pthread_attr_setstacksize(pthread_attr_t *attr, size_t size);
     int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *size);
     int pthread_attr_setstackaddr(pthread_attr_t *attr, void *addr);
     int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **addr);
     int pthread_attr_setdetachstate(pthread_attr_t *attr, int detach);
     int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detach);

DESCRIPTION
     A thread attributes object is a collection of values which specify how a
     thread is created [see pthread_create()].	Changes to the attribute
     values of the object do not affect threads already created using the
     object.  Size and location of the stack may be specified as well as the
     detached state [see pthread_detach()] and scheduling attributes [see
     pthread_attr_setscope() and pthread_attr_setinheritsched(3P)].

     The pthread_attr_init() function initializes the thread attributes object
     specified by attr and the function pthread_attr_destroy() destroys it.

     The stack size attribute is the minimum number of bytes used by a thread
     for its stack.  It is set in the object attr to the value of size using
     pthread_attr_setstacksize().  The current stack size for the attribute
     object attr is returned in the size parameter of
     pthread_attr_getstacksize().  The best way to find the default stacksize
     is to retrieve it from an initialized attribute object.  In IRIX this
     value is 0x20000 (128k) bytes.

     The stack address attribute is the address of storage allocated by the
     user that a thread will use as its stack.	It is set in the object attr
     to the value of addr using pthread_attr_setstackaddr().  If an address is
     specified it must reference memory of at least the size indicated by the
     stack size attribute value.  When no attribute value is specified memory
     will be allocated at an address chosen by the library and disposed of
     when the thread terminates.  The current stack address for the attribute
     object attr is returned in the addr parameter of
     pthread_attr_getstackaddr().  It is meaningless to request a value for
     the address attribute if none has been set.

     The detach state attribute determines whether storage for the thread will
     be reclaimed when it terminates.  It is set in the object attr to the
     value of detach using pthread_attr_setdetachstate().  A value of either
     PTHREAD_CREATE_JOINABLE (which is the default) or PTHREAD_CREATE_DETACHED

									Page 1

pthread_attr_init(3P)					 pthread_attr_init(3P)

     should be specified.  The initial thread is created with the detach state
     of PTHREAD_CREATE_JOINABLE.  The current detach state for the attribute
     object attr is returned in the detach parameter of
     pthread_attr_getdetachstate().

DIAGNOSTICS
     On success the attribute functions return zero; otherwise they return an
     error number.

     pthread_attr_setstacksize() can return the following error:

     [EINVAL]	    The stack size specified by size is too small [see NOTES].

     pthread_attr_setstackaddr() can return the following error:

     [EINVAL]	    The stack address specified by addr is illegal.

     pthread_attr_setdetachstate() can return the following error:

     [EINVAL]	    The value of detach is neither PTHREAD_CREATE_JOINABLE nor
		    PTHREAD_CREATE_DETACHED.

SEE ALSO
     pthread_create(3P), pthread_detach(3P), sysconf(3C).

NOTES
     The minimum stack size can be retrieved using sysconf(3C) using the
     THREAD_STACK_MIN option.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net