Skip to content

CF_ReadWriteLock

Category: multithreading
GitHub: cute_multithreading.h


An opaque handle representing a read-write lock.

Remarks

A read/write lock can have a large number of simultaneous readers, but only one writer at a time. This can be used as an opimization where a resources can be safely read from many threads. Then, when the resource must be modified a writer can wait for all readers to leave, and then exclusively lock to perform a write update.

cf_write_unlock
cf_make_rw_lock
cf_destroy_rw_lock
cf_read_lock
cf_read_unlock
cf_write_lock