3d5 Subj : Re: Improving read-write lock To : comp.programming.threads From : David Schwartz Date : Wed Feb 16 2005 12:18 pm "Marcin 'Qrczak' Kowalczyk" wrote in message news:87y8dol8tj.fsf@qrnik.zagroda... > "Joe Seigh" writes: > >>> It's not a perfect situation of course, because only one ReadPromotable >>> lock exists. >> >> More than one promotable read lock can exist. It just has to stay >> blocked >> until any pior promotable read locks have completed their write access. > > No, because if two threads holding promotable read locks try to > promote them, they will deadlock. > > Unless you meant a different semantics where promotion may allow other > writers to invervene. I think .NET provides something like this (with > a semi-reliable check whether some writer did actually intervene). If it does that, it's precisely equivalent to a read unlock followed by a write lock. DS . 0