dg_pthread_groupattr_init(3T) DG/UX 5.4R3.00 dg_pthread_groupattr_init(3T)
NAME
dg_pthread_groupattr_init, dg_pthread_groupattr_destroy - thread
group attributes objects
SYNOPSIS
#include <pthread.h>
int dg_pthread_groupattr_init(dg_pthread_groupattr_t *attr);
int dg_pthread_groupattr_destroy(dg_pthread_groupattr_t *attr);
where:
attr A pointer to a thread group attributes object
DESCRIPTION
DG thread group attributes objects are opaque collections of thread
group attributes that are used to override the default creation
attributes in calls to dg_pthread_group_create(). They can also be
used to change certain scheduling attributes, such as scheduling
policy and priority, of existing thread groups with calls to
dg_pthread_group_setschedattr().
Thread group attributes objects are manipulated only by object-
oriented functions described here and in other man pages listed
below. The use of opaque attributes objects provides a clean
isolation of the configurable aspects of thread groups and an
extensible mechanism for adding future DG attributes.
DG attributes are provided to specify the scheduling inheritance,
policy, and priority of a thread group. These attributes are similar
to those for threads. The scheduling policy and priority attributes
are the only attributes that can be modified or retrieved for an
existing thread group.
Before a thread group attributes object can be used, it must be
initialized by a call to dg_pthread_groupattr_init. After it has
been initialized, individual attributes are specified by other
object-oriented calls, then the attributes object is passed to a call
to dg_pthread_group_create() or dg_pthread_group_setschedattr().
Upon return from such a call, the attributes object is no longer
associated with the affected thread group, and can be destroyed by a
call to dg_pthread_groupattr_destroy(). If desired, the attributes
object need not be destroyed; it can instead be used in subsequent
calls to dg_pthread_group_create() or
dg_pthread_group_setschedattr().
The following functions initialize and destroy thread group
attributes objects:
dg_pthread_groupattr_init()
This function initializes the thread group attributes object pointed
to by attr with the default values for all thread group attributes.
Consult the other man pages below for the default values under DG/UX.
Licensed material--property of copyright holder(s) 1
dg_pthread_groupattr_init(3T) DG/UX 5.4R3.00 dg_pthread_groupattr_init(3T)
dg_pthread_groupattr_destroy()
This function destroys the thread group attributes object pointed to
by attr. The attributes object should have been initialized by a
previous call to dg_pthread_groupattr_init(). The behavior of using
the attributes object after it has been destroyed is undefined. If
DG/UX detects that an attributes object is uninitialized or
destroyed, it will cause the using function to fail with EINVAL.
DIAGNOSTICS
Returns
If successful, these functions return 0. Otherwise they return -1
and set errno to indicate the error.
Errors
For each of the following conditions, dg_pthread_groupattr_destroy()
returns -1 and sets errno to the corresponding value:
[EINVAL] An invalid attributes object has been specified. This
occurs when DG/UX has detected that the attributes object
pointed to by attr has not been initialized by a previous
call to dg_pthread_groupattr_init() or has been corrupted.
SEE ALSO
dg_pthread_groupattr_setinheritsched(3T),
dg_pthread_groupattr_getinheritsched(3T),
dg_pthread_groupattr_setsched(3T), dg_pthread_groupattr_getsched(3T),
dg_pthread_groupattr_setprio(3T), dg_pthread_groupattr_getprio(3T),
dg_pthread_group_create(3T), dg_pthread_group_setschedattr(3T),
dg_pthread_group_getschedattr(3T), dg_pthread_attr_setgroup(3T),
dg_pthread_attr_getgroup(3T), threads(5).
NOTES
Attributes objects are provided for threads, mutexes, condition
variables, and DG thread groups. While the attributes vary from
entity to entity, the style of the interfaces is consistent. For DG
thread groups, scheduling attributes similar to those for threads are
provided, but they affect the global scheduling of the target thread
group.
The effect of passing a NULL pointer to dg_pthread_group_create() is
the same as passing a pointer to a newly initialized thread group
attributes object. Both cases cause the default attributes to be
used. In particular, the scheduling attributes are inherited from
the creating thread group.
Refer to dg_pthread_attr_setgroup(3T) for specifying the group ID of
the group in which a newly created thread is to be created. The
current discussion treats only the attributes for thread groups,
themselves.
Licensed material--property of copyright holder(s) 2