Messages in this thread | | | Date | Fri, 11 Dec 1998 14:18:03 GMT | From | "Stephen C. Tweedie" <> | Subject | Re: Concurrent read/writes on the same file |
| |
Hi,
On Fri, 11 Dec 1998 08:52:06 +0000, Jamie Lokier <lkd@tantalophile.demon.co.uk> said:
> I thought one of the fundamentals was that read/write were atomic, if > they're not interrupted.
That's really bad for performance on a busy file, if you need to block for several IOs while generating the write traffic.
I seem to recall having seen some mention of atomic IO requirements on certain (very old) POSIX documents, but having atomic write semantics is not part of the Single Unix spec. (The behaviour is well defined before and after the write, but not during it.) My most recent copy of POSIX.1 also makes no atomicity guarantees, except for the special case of writes of PIPE_BUF or fewer bytes to a pipe.
> Wouldn't a per-inode rwlock_t be efficient for this? (Instead of the > current per-inode writer semaphore).
I've considered it before, but it would be terrible for performance. For database writes, you _really_ want to be able to queue multiple writes to the file at once and have the kernel sort them out (think asynchronous IO using threads).
--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/
| |