UNIX V6 进程交换时间

UNIX V6 processes swap time

试图了解著名的 UNIX 六级内核的工作原理。问题是在源码中https://pages.lip6.fr/Pierre.Sens/srcv6/进程切换是在什么地方触发的?

在 UNIX 源代码的 Lions 评论中,我在第 3725 行遇到了 clock() 函数。它是否触发进程交换?

尽管关于此源代码的信息足够多,但由于 197x 和 201x 编程文本和术语的风格不同,我还是被卡住了。

上面 Margaret Bloom 的评论给了我一个线索,但我没有看到复选标记,否则我会接受它作为答案。 (显然因为它只是评论) 下一个可能是更展开的版本:

1) slp.c 的第 1923 行说:"Although it is not remarkably evident, the basic synchronization here is on the runin flag, which is slept on and is set once per second by the clock routine. Core shuffling therefore takes place once per second"

2) Lion 在第 11 章时钟中断中的评论说:"Which ever clock is used, interrupts are generated at line frequency (i.e. with a 50 Hz power supply, every 20 milliseconds)"

3) 源代码第0147行:时钟/#define HZ 60 / Ticks/second。

4) 第 14 章程序交换(第 14.2 节):进程 #0 执行“sched”。等等关于runinrunout.

所以clock()是一个中断服务程序(IRS)。函数sched()是进程号0。