Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Dec 1998 00:24:35 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        marcs@znep.com (Marc Slemko)
Cc:        lists@tar.com, hackers@FreeBSD.ORG
Subject:   Re: pread/pwrite
Message-ID:  <199812130024.RAA13176@usr01.primenet.com>
In-Reply-To: <Pine.BSF.4.05.9812101418070.463-100000@alive.znep.com> from "Marc Slemko" at Dec 10, 98 02:20:22 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> (not necessarily addressed specifically at pread/pwrite, but it does
> apply to it because of how it is used...)
> 
> Where is the locking if multiple threads are reading and/or writing
> from or to the same descriptor at the same time?  If you have x
> threads reading from a descriptor opened from a file on disk, do
> x-1 of them have to wait until the first one finishes before they can
> do anything?

Locking is unnecessary, since the intent of the lock is to prevent
moving the file pointer around.

If you wrapper the operations at all, it should be for call
conversion.  I really don't know why this would be necessary on
a local FS, and since seeks don't apply to things like serial
ports, there's no reason for using pread/pwrite instead of read/write,
so pread/pwrite is not really useful in terms of call conversion.

Hmmm.  Given the implemetnation, I would expect them to error out
on non-seekable devices, in fact.

Actually pread/pwrite is how SunOS 4.1.3 implemented liblwp, which
was Sun's first released threading implementation, and which was also
user space.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812130024.RAA13176>