From owner-freebsd-hackers Fri Nov 15 14:17:44 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA21114 for hackers-outgoing; Fri, 15 Nov 1996 14:17:44 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA21107 for ; Fri, 15 Nov 1996 14:17:39 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id PAA27125; Fri, 15 Nov 1996 15:04:32 -0700 From: Terry Lambert Message-Id: <199611152204.PAA27125@phaeton.artisoft.com> Subject: Re: Sockets question... To: jgreco@brasil.moneng.mei.com (Joe Greco) Date: Fri, 15 Nov 1996 15:04:32 -0700 (MST) Cc: fenner@parc.xerox.com, jgreco@brasil.moneng.mei.com, hackers@freebsd.org In-Reply-To: <199611152059.OAA28943@brasil.moneng.mei.com> from "Joe Greco" at Nov 15, 96 02:59:34 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Ummm... and the problem is...? > > As far as I am aware, byte oriented data can be written to unaligned > addresses on any UNIX architecture that I have seen. It's not efficient. It may take multiple bus cycles each time you break for more data making it not-as-fast-as-it-could-be. It is ugly and inelegant. It offends our aesthetics. > xread is explicitly called with what is clearly a byte oriented buffer. You could make the same arguments about bcopy, but we've optimized it for alignment boundries anyway. > If you are possibly worried about something such as the atomicity of > reads (potentially valid in a threaded environment, or one using shared > memory), I agree that there may be some concern. Since it is not clear > to _me_ that such atomicity of access would be valid under the same > circumstances even with read(), I would probably code around the > situation anyways. > > Is there some other problem that I am missing? I've done this sort of > things for several years now... Non-shared memory, but using a mmap'ed region as the destination buffer. In this case, I want to validate the target address range once and copy direct out of the frag buffers into the user buffer. I can make similar arguments about write's of a mmap'ed region. I believe that an FTP server sending files to a client would qualify, after the initial descriptor header is sent, and the only thing left to send is the file data. Further, if tthe kernel detected this happening, it could asynchronusly complete, and delay the unmapping until the transmit was complete, tunring almost the entire transaction around in kernel space. The same thing goes for whole file downloads (ie: .EXE, .DLL, etc.) for DOS clients of a UNIX server. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.