- 论坛徽章:
- 0
|
这篇Jeff Berryman 1972年写的关于“虚拟内存管理”的小品文,是我见到的关于VM的最好的说明文档。翻译了前半部分(寓言故事的部分),与大家共享。
duke_gun
2005/11/17
Rules
1. Each player gets several million things.
2. Things are kept in crates that hold 4096 things each. Things in the same crate are
called crate-mates.
3. Crates are stored either in the workshop or the warehouse. The workshop is almost
always too small to hold all the crates.
4. There is only one workshop but there may be several warehouses. Everybody shares
them.
5. Each thing has its own thing number.
6. What you do with a thing is to zark it. Everybody takes turns zarking.
7. You can only zark your things, not anybody else's.
8. Things can only be zarked when they are in the workshop.
9. Only the Thing King knows whether a thing is in the workshop or in a warehouse.
10. The longer a thing goes without being zarked, the grubbier it is said to become.
11. The way you get things is to ask the Thing King. He only gives out things in multiples
of eight. This is to keep the royal overhead down.
12. 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 a workshop it gets zarked right away. If it is in a warehouse, the
Thing King packs the crate containing your thing back into the workshop. If there is no
room in the workshop, he first finds the grubbiest crate in the workshop, whether it be
yours or somebody else's, and packs it off with all its crate-mates to a warehouse. In
its place he puts the crate containing your thing. Your thing then gets zarked and you
never know that it wasn't in the workshop all along.
13. Each player 's stock of things have the same numbers as everybody else's. The Thing
King always knows who owns what thing and whose turn it is, so you can't ever
accidentally zark somebody else's thing even if it has the same thing number as one of
yours.
Notes
1. Traditionally, the Thing King sits at a large, segmented table and is attended to by
pages (the so-called "table pages") whose job it is to help the king remember where
all the things are and who they belong to.
2. One consequence of Rule 13 is that everybody's thing numbers will be similar from
game to game, regardless of the number of players.
3. The Thing King has a few things of his own, some of which move back and forth
between workshop and warehouse just like anybody else's, but some of which are just
too heavy to move out of the workshop.
4. With the given set of rules, oft-zarked things tend to get kept mostly in the workshop
while little-zarked things stay mostly in a warehouse. This is efficient stock control.
Long Live the Thing King!
规则
1.每位选手都有数以百万计的Things.
2.所有的Things都保存在箱子里,每个箱子可以保存4096个Things.保存在同一个箱子里的Things互为“箱友”。
3.箱子只能放置在车间或者仓库中。车间太小了,总是放不下所有的箱子。
4.车间只有一个,仓库却有多个。所有选手共用车间和仓库。
5.每个Thing都有一个Thing number.
6.选手的工作就是对Things进行锻压,所有人轮流进行锻压操作。
7. 你只能锻压自己的Things,而绝不能锻压别人的。
8.只能在车间里对Things进行锻压。
9.只有Thing King才知道一个Thing究竟是在车间里还是在仓库里。
10.一个Thing得不到锻压的时间越长,就越可能被认为是废品(被标记为”dirty”)。
11.选手要通过Thing King才能开展工作。Thing King每次给出的Thing的数目是8的整数倍,这是为了降低维护性开销。
12.你要锻压一个Thing,只需给出它的Thing number.如果你所说的Thing恰好就在车间里,它立即就会被锻压。如果它在仓库里,Thing King负责把装它的那个箱子搬运到车间来。如果车间里没有了空位,Thing King会找出车间里最脏的(等待被锻压时间最长的)箱子——不管它是你的还是谁的,搭载这个箱子过来的“箱友”都会被赶出车间,回到仓库。Thing King为你的箱子找到了空位,接着就去锻压你说的那个Thing了。想一想,当你提到某个Thing时,你知道它在车间还是仓库里吗——你总是不知道;当你看到你说的Thing被锻压了,你了解Thing King所作的上述工作吗——你总是不知道。这些对你都是透明的(transparent)——存在但你却看不到。
13.所有选手的Things采用同样的编号方式。Thing King总是清楚哪个Thing是哪个选手的以及现在该谁来操作锻压了。所以,即使存在你的Thing和别人的Thing使用同样编号(number)的现象,你也不会偶尔锻压了别人的Thing.
说明
1.传统上,Thing King会坐在一个巨大的、分成一段一段的桌子旁边,附近还有一些页(被称作“桌页”)。桌页用来帮助Thing King记住所有的Things在什么地方、属于谁。
2.规则13带来的一个现象就是在各场游戏中,无论选手人数多还是少,每个选手的Thing number都很相似。
3.Thing King也有自己的Things,其中一些Things会和选手们的Things一样,在车间和仓库间搬来搬去;也有一些实在太重了,只能长期留在车间里。
4.根据给定的规则,经常被锻压的Things会被尽可能地留在车间里;那些很少会被锻压的Things会被尽可能地留在仓库里。这有助于提高存储控制的效率。 |
|