lkml.org 
[lkml]   [1998]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Concurrent read/writes on the same file
On Wed, Dec 09, 1998 at 11:50:02AM +0000, Stephen C. Tweedie wrote:
> On Wed, 9 Dec 1998 16:55:30 +1300, Chris Wedgwood <cw@ix.net.nz> said:
> > What about one reader and one writer -- here I assume the read is
> > locked, or do we just get trashed data? (Assuming we do, its still
> > OK, it really up to an application to not read/write to a file at the
> > same time and expect consistency).
>
> No automatic locking is done in the kernel for this case. Use kernel
> record locking with flock/fcntl if you want that: that's what it's
> there for!
>
> I've considered it more than once, but the performance penalty of
> doing range locking is too high --- it pollutes the fast path of
> accessing data in the cache --- and locking the entire inode destroys
> parallelism.

I thought one of the fundamentals was that read/write were atomic, if
they're not interrupted.

Wouldn't a per-inode rwlock_t be efficient for this? (Instead of the
current per-inode writer semaphore).

-- Jamie

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.497 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site