The Paging Game
The following is a technical update to IBM's explaination of how virtual
memory works. It was written by Jeff Berryman of the University of British
Columbia and distributed at a share meeting shortly after IBM announced
virtual memory for the 370 series.
RULES:
Each player gets several million "things".
"Things" are kept in "crates" that hold 4096 "things"
apiece. "Things" in the same "crate" are called "crate-mates".
"Crates" are stored either in the "workshop" or the
"warehouse". The workshop is almost always too small to hold all the crates.
There is only one workshop, but there may be many warehouses. Everybody shares these.
To identify things, each thing has its own "thing number".
What you do with a thing is to "zark" it. Everybody takes turns zarking.
You can only "zark" your things or shared things, not anyone else's.
Things can only be "zarked" when they are in the workshop.
Only the "Thing King" knows whether a thing is in the workshop or the
warehouse.
The longer the things in a crate go without being zarked, the grubbier the crate is said
to become.
The way you get things is to ask the "Thing King". He only gives out things in
multiples of 4096 (that is, "crates"). This is to keep the royal overhead down.
The way you zark a thing is to give its thing number. If you give the number of a thing
that happens to be in the workshop, it gets zarked right away. If it is in a warehouse, the
Thing King packs the crate containing your thing into the workshop. If there is no room in
the workshop, he first find the grubbiest crate in the workshop (irregardless of whether it
is yours or someone else's) and packs it off (along with its crate-mates) to a
warehouse. In its place he puts the crate containing your thing. Your thing then gets
zarked, and you never knew that it wasn"t in the workshop all along.
Each player"s stock of things has the same thing numbers (to the players) as
everyone else"s. The Thing King always knows who owns what thing, and whose turn it is
to zark. Thus, one player can never accidentally zark another player"s things, even
though they may have the same thing numbers.
NOTES:
Traditionally, the Thing King sits at a large, segmented table, and is attended by pages
(the so-called "table pages") whose job it is to help the Thing King remember
where all the things are and to whom they belong.
One consequence of rule #13 is that everyone's thing numbers will be the similar
from game to game, regardless of the number of players.
The Thing King has a few things of his own, some of which get grubbier, just as
player's things do, and so move back and forth between the workshop and the warehouse.
Other things are used too often to get grubby, or are just to heavy to move.
With the given set of rules, oft-zarked things tend to get kept mostly in the workshop,
while little-zarked things stay mostly out in the warehouse. This is efficient stock
control.
Sometimes even the warehouses get full. The Thing King then has to start piling crates
upon the dump out back. This makes the game slower because it takes a long time to get thing
off the dump when they are needed in the workshop. In this case, the Thing King selects the
grubbiest crates he can find in the warehouses and sends them to the dump in his spare time,
thus keeping the warehouses from getting too full. This also means that the least-often
zarked things end up on the dump, so the Thing King won"t have to get things from the
dump so often. This speeds up the game when there are a lot of players and the warehouses
are getting full.
|