Date: Tue, 13 Apr 1999 16:54:31 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Jason Thorpe <thorpej@nas.nasa.gov> Cc: Ville-Pertti Keinonen <will@iki.fi>, hackers@FreeBSD.ORG Subject: Re: read() and pread() syscalls Message-ID: <199904132354.QAA23919@apollo.backplane.com> References: <199904121916.MAA07413@lestat.nas.nasa.gov>
index | next in thread | previous in thread | raw e-mail
:On 12 Apr 1999 17:01:50 +0300
: Ville-Pertti Keinonen <will@iki.fi> wrote:
:
: > This may come as a shock to you, but read(2)/write(2) aren't atomic in
: > updating the file pointer, either.
:
:Then that's a bug in the FreeBSD kernel.
:
: > Actually, read(2) is equivalent to lseek(2)+pread(2)+lseek(2), with the
: > last lseek(2) being SEEK_CUR by the read count returned by pread(2).
: > The difference is that read(2) can only be pre-empted if it blocks
: > doing I/O (which is not unusual).
:
:Geez, how did this get implemented in FreeBSD?! It's certainly not that
:complicated.
:
: -- Jason R. Thorpe <thorpej@nas.nasa.gov>
There's an overriding issue with all of this related to the fact that
vnodes have only one lock structure associated with them. What we really
need are two lock structures -- one that can be used as a rename/delete
interlock against namei, allowing namei operations to run in parallel and
not block each other out, and a second one that handles everything else.
Atomicy can be handle by creating a second POSIX locking structure for
the vnode which could be used by the kernel to parallelize read and write
ops.
If there were five of me, I'd go and do it. But I've got my hands full.
-Matt
Matthew Dillon
<dillon@backplane.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904132354.QAA23919>
