Installation guide
since the developer must, by intimate knowledge of the machine architecture
and implementation, know the correct address to specify relative to the
allocated stack. The implementation cannot diagnose an incorrect value
because the interface does not provide sufficient information. Using an
incorrect value might result in program failure, possibly in obscure ways.
5.3.5 DECthreads Read-Write Locks
DECthreads now supports read-write locks. A read-write lock is a
synchronization object for protecting a data object that can be accessed
concurrently by more than one thread in the same program. Unlike a mutex, a
read-write lock distinguishes between shared read and exclusive write
operations on the shared data object. A read-write lock is most useful in
protecting a shared data object that is read frequently and modified less
frequently. The following routines provide access to the read-write lock
capability:
• pthread_rwlockattr_destroy(3)
• pthread_rwlockattr_init(3)
• pthread_rwlock_destroy(3)
• pthread_rwlock_init(3)
• pthread_rwlock-rdlock(3)
• pthread_rwlock_tryrdlock(3)
• pthread_rwlock_trywrlock(3)
• pthread_rwlock_unlock(3)
• pthread_rwlock_wrlock(3)
For more information about read-write locks, see the reference pages for
these routines.
5.3.6 DECthreads Object Naming
DECthreads now allows you to assign names, as C language strings, to
thread objects including threads, mutexes, condition variables, and read-write
locks (see Section 5.3.5 ). During debugging, you can use these names to
help identify individual objects by function rather than by the numeric
identifiers the thread library assigns. The Ladebug debugger and the Visual
Threads analysis tool (see Section 1.11 ) include these names when
displaying information about thread objects. Other debuggers and analysis
tools can also use the names you have assigned.
Use the following routines to assign and retrieve object names:
• pthread_attr_getname_np(3)
Development Environment Notes 5–5