shared system routines

jbray at bbn-unix jbray at bbn-unix
Thu Jul 28 05:20:43 AEST 1983


From:  James Bray <jbray at bbn-unix>

What you are talking about here is a Run-Time Library. This is something
which the Gods would indeed smile upon, had they not in their imponderable
wisdom created Unix without shared segments or things of this sort. As Unix
grows into the more advanced hardware which it now finds itself on, these
should become available. We are told that system V, which I should have and
be upgrading our Unix to any day now, has some sort of shared-memory capability
between processes. I would be most interested if someone who has actually seen
the code could describe it, as shared memory for unix can be done either of
two ways: as a major architectural change involving work all over the place
in the kernel and breaking everything in the process -- the way it should be
done -- or as a bizarre and inelegant hack, sort of like using pipes and ports
as interprocess communication.
  In any case, what you want is something like, to hark back for the umpteenth
time to my last job, the way Perkin-Elmer's OS/32 (a big assembly-language
mess with a horrible user interface which makes it look like a bizarre form of
torture compared to unix, and all this neat real-time type stuff, which makes
unix look like a toy compared to it (I'll take unix any day, but would really
like both)) does it, which is named, shared, read-only segments in memory which
are loaded when the first process having need of their contents is loaded, and
which subseqeunt users merely link to. The way this all works is that one
builds this thing just like a library, putting all the right stuff in it, and
then one has one's loader scan this thing for needed library routines before
getting them in the usual way; the loader builds a link into the task image
that points to this segment, and pulls it in off the disk if not already
resident, at run-time. You can do all sorts of great things with shared
segments, but as one can imagine they rather complicate questions concerning
core management, especially swapping. But it is worth it; they save not only
disk space, but a lot of core as well.
  What you don't want to do is start putting the stuff in the kernel, unless
you do it via a very restrictive and well-defined system-service interface. It
is much nicer to have shared run-time libraries.

--Jim Bray



More information about the Comp.unix.wizards mailing list