Subj : Re: performance of single mutex versus Read/write mutex: any numbers? discuss To : comp.programming.threads From : Chris Thomasson Date : Mon Oct 10 2005 04:59 pm > It contains demo test code which attempts to justify the use case for > read/write and even read/write/upgradable locks. Timing results for a > dual processor machine are presented. You should really take Joes advice and measure how many iterations/reads a thread can perform per-second. That is basically the only way to get some "real" performance numbers... :) > The link also describes a "lock > reduced" mutex which avoids locking an OS-based mutex if there is no > contention, although there is no code, just hand-waving. Here is some experiential pseudo-code for a fast-pathed rw-mutex: http://groups.google.com/group/comp.programming.threads/msg/816a18f5ea5c3bda?hl=en This seems to outperform nearly all non-distributed rw-mutex implementations I have tested against; unfortunately, most of them use mutexs and condition variables to manage their internal bookkeeping. They "all", including the fast-pathed ones, seem to tank once you put them in a "contentious situation". IMO, the atomic operations and StoreLoad memory barriers make it difficult for rw-mutex's to scale... .