
Peter Dimov wrote: [...]
The first one is broken, because the whole point of postponing the write lock is to allow readers to operate at full speed. However, if readers operate at full speed, then there is no guarantee that the write lock will ever succeed; ergo, starvation. So promotion is good only for non-critical updates.
Not quite. It depends. I have a read/write lock which is "almost" starvation-free (it uses single "entry" lock for both readers and writes, so that the scheduling protocol for that entry lock drives the whole read/write locking without the need to choose between reader or writer preference policy which could cause reader or writer starvation). Upgradeability was the design driving force... http://groups.google.com/groups?selm=3B166244.F923B993%40web.de regards, alexander.