[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Virtual Memory



>>>>> "Stephan" == Stephan Haslbeck <haslbecs@informatik.tu-muenchen.de> writes:


Stephan> And what if the space is blocked by another program that
Stephan> won't stop for a long time (or never)? Only programs that are
Stephan> expected to exit quickly after their start can run under such
Stephan> conditions. I think there would be more restrictions than
Stephan> without any VM.

You could do the swapping on context-shift. Remember the kernel has
control at frequent intervals.

For two large programs communicating heavily through a pipe, this
would be deadly slow, but it will allow you to run an number of
processes subject only to the restrictions that no process can be
larger than physical memory and the sum of the sizes of all processes
must not exceed the swap area. And that would be a big plus, even on a
slow 68000 with a slow disk. It can mean the difference between succes
and failure.

And performance will even be close to tolerable in the cases where the
parent blocks and waits for the child (or any other condition) as it
is only processes that actually can run that are swapped back in.

Another obvious optimization would be to only replace the memory
needed, not necessarily whole processes. I.e. you can have your emacs
take over the entire physical memory and when dired has run `ls', only
the bottom part of emacs needs to be swapped back in (of course there
are a number of boundary conditions here).

In fact, I think that most UNIX still uses swapping as well as paging.


------------------------------------------------------------------------------
Christian Lynbech               | Hit the philistines three times over the 
office: R0.33 (phone: 3217)	| head with the Elisp reference manual.
email: lynbech@daimi.aau.dk	|        - petonic@hal.com (Michael A. Petonic)
------------------------------------------------------------------------------