🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #22407

Re: mmap() vs. read() (Was: Re: the Multics from the black lagoon :-))

#22407
From: Mark Crispin
Date: Tue, 13 Feb 1990 01:38
22 lines
2041 bytes
In article <1990Feb13.003010.23356@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>In article <131682@sun.Eng.Sun.COM> gingell@sun.UUCP (Rob Gingell) writes:
>>... At the very least, the read() version will be slower
>>than the mmap() version by the amount of time required to effect the
>>copies from kernel to program buffers...
>
>Assuming your MMU can do copy-on-write, why copy?

I don't see anything that says that read() has to be on a page or
even a word boundary.  I haven't seen a description of mmap(), but
usually file/memory mapping is whole pages on page boundaries, so the
swapper can swap in/out the pages directly from/to the file.

 _____     ____ ---+---   /-\   Mark Crispin           Atheist & Proud
 _|_|_  _|_ ||  ___|__   /  /   6158 Lariat Loop NE    R90/6 pilot
|_|_|_| /|\-++- |=====| /  /    Bainbridge Island, WA  "Gaijin! Gaijin!"
 --|--   | |||| |_____|   / \   USA  98110-2098        "Gaijin ha doko ka?"
  /|\    | |/\| _______  /   \  +1 (206) 842-2385      "Niichan ha gaijin."
 / | \   | |__| /     \ /     \ mrc@CAC.Washington.EDU "Chigau. Gaijin ja nai.
kisha no kisha ga kisha de kisha-shita                  Omae ha gaijin darou."
sumomo mo momo, momo mo momo, momo ni mo iroiro aru    "Iie, boku ha nihonjin."
uraniwa ni wa niwa, niwa ni wa niwa niwatori ga iru    "Souka. Yappari gaijin!"
Technical Details
Message-ID: <5721@blake.acs.washington.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mintaka!ogicse!blake!Tomobiki-Cho!mrc
References: <8859@portia.Stanford.EDU> <20571@watdragon.waterloo.edu> <1990Feb12.053616.11455@Solbourne.COM> <3556@rti.UUCP> <10468@alice.UUCP> <131682@sun.Eng.Sun.COM> <1990Feb13.003010.23356@utzoo.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mintaka!ogicse!blake!Tomobiki-Cho!mrc
From: mrc@Tomobiki-Cho.CAC.Washington.EDU (Mark Crispin)
Newsgroups: comp.arch
Subject: Re: mmap() vs. read() (Was: Re: the Multics from the black lagoon :-))
Message-ID: <5721@blake.acs.washington.edu>
Date: 13 Feb 90 01:38:51 GMT
References: <8859@portia.Stanford.EDU> <20571@watdragon.waterloo.edu> <1990Feb12.053616.11455@Solbourne.COM> <3556@rti.UUCP> <10468@alice.UUCP> <131682@sun.Eng.Sun.COM> <1990Feb13.003010.23356@utzoo.uucp>
Sender: news@blake.acs.washington.edu
Organization: Mendou Zaibatsu, Tomobiki-Cho, Butsumetsu-Shi
Lines: 22