Re: Concurrent read/writes on the same file

Stephen C. Tweedie (sct@redhat.com)
Mon, 14 Dec 1998 20:50:26 GMT


Hi,

On Sun, 13 Dec 1998 17:21:55 +0000, Jamie Lokier
<lkd@tantalophile.demon.co.uk> said:

> I meant a read-write semaphore, which it appears we don't have.
> Why not?

Because nobody has implemented one yet.

FWIW, we don't need to lock stuff for write. What we _do_ need is to
lock allocations, and we need that for both read AND write. I think we
can probably fix all of the dangerous cases by adding a r/w truncate
semaphore to the inode, taking it in read mode for reads and writes and
in write mode for truncate(). That way we maintain concurrency while
still eliminating the nasty truncate races which caused that semaphore
to be put there in the first place.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/