Re: Read/write locks

H. Peter Anvin (hpa@transmeta.com)
21 Sep 1997 07:20:47 GMT


Followup to: <199709210429.AAA28617@jenolan.rutgers.edu>
By author: "David S. Miller" <davem@jenolan.rutgers.edu>
In newsgroup: linux.dev.kernel
>
> An update lock lets you read the structure while guaranteeing it
> will not change, and also that you can upgrade it to a write lock
> without the structure changing.
>
> Perhaps I'm feeling dense this evening, but what in the world is the
> difference then between holding the update lock and holding a rwlock
> as a writer? I can't see it...
>

The way I read it, the "update lock" operation supports transitioning
from a read lock to a write lock guaranteeing that no other writers
can come in between, as you could if you just released the read lock
and grabbed a write one.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/