On Tue, Jul 31, 2001 at 09:33:42AM +0200, Graham Leggett wrote: > > A read/write lock will allow simultaneous "readers", and will provide > > exclusive "writers". As an application developer using APR, you'd have to > > use apr_lock_acquire_rw() instead of the normal apr_lock_acquire() you > > use with a mutex, so that you can ask for a read or a write lock. What this > > gives you is finer grain control over how much parallization certain parts > > of you code may endure. > > Ok - In the code I am busy porting, a shared memory cache is > implemented. When something writes to the cache, nothing else must read > or write. When something is read from the cache, anyone else may read > simultaneously without a problem. Is this a job for a read/write lock?
That sounds right to me. Make sure the lock exists in your shared memory address space (of course) :) -aaron
