Article View: comp.arch
Article #22268Re: the Multics from the black lagoon :-)
From: Wm E Davidsen Jr
Date: Thu, 08 Feb 1990 19:48
Date: Thu, 08 Feb 1990 19:48
56 lines
2998 bytes
2998 bytes
In article <1990Feb7.221800.804@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
| Gee, how could we ever have lived without that for two decades? :-)
| Maybe because we don't need it and it doesn't buy us very much?
There are lot of things we don't *need* which really improve life to
have. Having used direct mapping of files on multics and VMS, I can say
that in those cases the logic was simpler, the source smaller and more
readable, the executable smaller, and the performance better.
File mapping, for background, means treating a file like an array. It
eliminates the explicit calls to seek and restrictions about mixing read
and write without an intervening seek. It allows elements from the file
to be used in expressions without lots of explicit file io, and replaces
the runtime and kernel buffering scheme with the kernel page mechanism,
which is often much faster.
In VMS the performance gain was about 30%, and the program was smaller
as well. We lived without many things, and I thought you were a defender
of a lot of them, such as C standards, symbolic debuggers, etc. You're
right that we can live without them, but totally wrong about "it soesn't
buy us very much."
Perhaps someone who has used the BSD mapping (is is mmap()?) could
give us some actual timings on unix, since my experience is with other
systems. Is mapping in V.4???
Examples
I/O code:
/* update the current record */
temp.units = 4;
fseek(wkfile, (long)currec * sizeof(temp), 0);
fwrite((char *)&temp, sizeof(temp), 1, wkfile);
currec++; /* write moved the record pointer */
/* read the next, fseek to allow read after write */
fseek(wkfile, 0L, 1); /* NULL seek */
fread((char *)&temp, sizeof(temp), 1, wkfile);
/* use the value */
m = 20 * temp.headlimit;
mapped:
/* something *like* this does the mapping, like open */
work = (struct demo *)mmap(filename, "r+");
/* here's the actual code */
work[currec++].units = 4;
m = 20 * work[currec].headlimit;
________________________________________________________________
Okay, I typed it in, please don't tell me there are typos or I left
out something, unless it is major. I just think this makes really easier
code to write and maintain.
--
bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"Stupidity, like virtue, is its own reward" -me
Technical Details
Message-ID:
<2106@crdos1.crd.ge.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!crdgw1!crdos1!davidsenReferences:
<8859@portia.Stanford.EDU> <20571@watdragon.waterloo.edu> <49956@sgi.sgi.com> <4791@helios.ee.lbl.gov> <2093@crdos1.crd.ge.COM> <1990Feb7.221800.804@utzoo.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.arch Subject: Re: the Multics from the black lagoon :-) Message-ID: <2106@crdos1.crd.ge.COM> Date: 8 Feb 90 19:48:16 GMT References: <8859@portia.Stanford.EDU> <20571@watdragon.waterloo.edu> <49956@sgi.sgi.com> <4791@helios.ee.lbl.gov> <2093@crdos1.crd.ge.COM> <1990Feb7.221800.804@utzoo.uucp> Reply-To: davidsen@crdos1.crd.ge.com (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 56