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.

The table below lists important read/write lock attributes, their default values, and all supported values.

Attribute Default value Supported values
pshared PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED

For information about the examples included with the APIs, see the information on the API examples.

The Read/write lock synchronization APIs are:


Top | Pthread APIs | APIs by category