Dave's Brain

Browse - programming tips - read write lock

Date: 2007nov6

Q.  A critical section is too strong for my application.
I only want other threads excluded when changes are made to the
shared data.

A.  You want a read-write lock.

In Linux/Unix check the man page for pthread_rwlock_rdlock

Windows does not have native support for read-write locks.
We have succesfully used KReadWriteLock by Ivan Krivyakov
http://www.codeguru.com/cpp/w-p/system/misc/article.php/c5679/

Add a comment

Sign in to add a comment
Copyright © 2008, dave - Code on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License.