[Prev] [Contents] [Next]

Read/Write Lock Synchronization APIs

Read/write locks help you build more complex applications without using mutexes and condition variables to provide your own read/write locking primitive object. Read/Write locks provide a synchronization mechanism that allow threads in an application to more accurately reflect the type of access to a shared resource that they require.

Many threads can acquire the same read/write lock if they acquire a shared read lock on the read/write lock object. Only one thread can acquire an exclusive write lock on a read/write lock object. When an exclusive write lock is held, no other threads are allowed to hold any lock.
pthread_rwlockattr_destroy()--Destroy Read/Write Lock Attribute
pthread_rwlockattr_getpshared()--Get Pshared Read/Write Lock Attribute
pthread_rwlockattr_init()--Initialize Read/Write Lock Attribute
pthread_rwlockattr_setpshared()--Set Pshared Read/Write Lock Attribute
pthread_rwlock_destroy()--Destroy a Read/Write Lock
pthread_rwlock_init()--Initialize a Read/Write Lock
pthread_rwlock_rdlock()--Get a Shared Read Lock
pthread_rwlock_timedrdlock_np()--Get a Shared Read Lock with Time-out
pthread_rwlock_timedwrlock_np()--Get an Exclusive Write Lock with Time-out
pthread_rwlock_tryrdlock()--Get a Shared Read Lock with No Wait
pthread_rwlock_trywrlock()--Get an Exclusive Write Lock with No Wait
pthread_rwlock_unlock()--Unlock an Exclusive Write or Shared Read Lock
pthread_rwlock_wrlock()--Get an Exclusive Write Lock



[Prev] [Contents] [Next]
Copyright © 1998, IBM Corporation. All rights reserved.
Comments? Contact
rchthrds@us.ibm.com