Date: Fri, 15 Nov 1996 15:04:32 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: jgreco@brasil.moneng.mei.com (Joe Greco) Cc: fenner@parc.xerox.com, jgreco@brasil.moneng.mei.com, hackers@freebsd.org Subject: Re: Sockets question... Message-ID: <199611152204.PAA27125@phaeton.artisoft.com> In-Reply-To: <199611152059.OAA28943@brasil.moneng.mei.com> from "Joe Greco" at Nov 15, 96 02:59:34 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611152204.PAA27125>