From owner-freebsd-hackers Sat Dec 12 16:24:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA16860 for freebsd-hackers-outgoing; Sat, 12 Dec 1998 16:24:49 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA16854 for ; Sat, 12 Dec 1998 16:24:46 -0800 (PST) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id RAA15011; Sat, 12 Dec 1998 17:24:40 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp01.primenet.com, id smtpd014967; Sat Dec 12 17:24:36 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id RAA13176; Sat, 12 Dec 1998 17:24:35 -0700 (MST) From: Terry Lambert Message-Id: <199812130024.RAA13176@usr01.primenet.com> Subject: Re: pread/pwrite To: marcs@znep.com (Marc Slemko) Date: Sun, 13 Dec 1998 00:24:35 +0000 (GMT) Cc: lists@tar.com, hackers@FreeBSD.ORG In-Reply-To: from "Marc Slemko" at Dec 10, 98 02:20:22 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > (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