OSF DCE Application Development Guide--Core Components
Thread Concepts and Operations
7.3.3.4 Stacksize Attribute
The stacksize attribute is the minimum size (in bytes) of the memory required for a
thread’s stack. The default value is machine dependent. Set this attribute by calling the
pthread_attr_setstacksize( ) routine.
7.3.4 Mutex Attributes
A mutex attributes object allows you to specify values for mutex attributes other than the
defaults when you create a mutex with the routine pthread_mutex_init( ).
The mutex type attribute specifies whether a mutex is fast, recursive, or nonrecursive.
Set the mutex type attribute by calling the routine pthread_mutexattr_setkind_np( ).
(Any routine with the _np suffix is a new primitive; see Section 7.2.) If you do not use a
mutex attributes object to select a mutex type, calling the pthread_mutex_init( ) routine
creates a fast mutex by default.
7.3.5 Condition Variable Attributes
Currently, attributes affecting condition variables are not defined. You cannot change
any attributes in the condition variable attributes object.
Section 7.4.2 describes the purpose and uses of condition variables.
7.4 Synchronization Objects
In a multithreaded program, you must use synchronization objects whenever there is a
possibility of corruption of shared data or conflicting scheduling of threads that have
mutual scheduling dependencies. The following subsections discuss two kinds of
synchronization objects: mutexes and condition variables.
7.4.1 Mutexes
A mutex (mutual exclusion) is an object that multiple threads use to ensure the integrity
of a shared resource that they access, most commonly shared data. A mutex has two
states: locked and unlocked. For each piece of shared data, all threads accessing that
data must use the same mutex; each thread locks the mutex before it accesses the shared
data and unlocks the mutex when it is finished accessing that data. If the mutex is locked
124245 Tandem Computers Incorporated 7−7