Most processes can be described as either I/O bound or CPU bound.
大多数进程都可以描述为IO绑定或者CPU绑定。
An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations. A CPU-bound process, in contrast, generates I/O requests infrequently, using more of its time doing computations.
IO绑定的进程是花更多的时间做io相关工作,而CPU绑定进程请求IO不那么频繁,而是花更多时间在计算上。
It is important that the long-term scheduler select a good process mix of I/O-bound and CPU-bound processes. If all processes are I/O bound, the ready queue will almost always be empty, and the short-term scheduler will have little to do.
好的长调度应该平均选择IO绑定和CPU绑定的进程数量。如果所有进程都是IO绑定,那么准备队列就会差不多是空的,短调度就会没事干。
If all processes are CPU bound, the I/O waiting queue will almost always be empty, devices will go unused, and again the system will be unbalanced.
如果所有的进程都是CPU绑定,那么IO等待队列就会差不多是空的,这些设备就闲置了。那么系统也是不平衡(两种资源)的。
The system with the best performance will thus have a combination of CPU-bound and I/O-bound processes.
系统要发挥好性能就需要平均组合CPU绑定和IO绑定的程序。
On some systems, the long-term scheduler may be absent or minimal.
某些系统的长调度也许没有或者很少使用。
For example, time-sharing systems such as UNIX and Microsoft Windows systems often have no long-term scheduler but simply put every new process in memory for the short-term scheduler.
例如,分时系统如UNIX和Microsoft Windows系统经常没有长调度,只是简单地吧所以新的进程加载如内存,以供短调度调度。
The stability of these systems depends either on a physical limitation (such as the number of available terminals) or on the self-adjusting nature of human users. If performance declines to unacceptable levels on a multiuser system, some users will simply quit.
这些系统的稳定性或者是由系统物理极限限制(例如,终端数量)或者是由用户的自我调节控制。如果一个多用户的系统性能下降到一个不可接受的水平,那么有些用户就会退出。
Some operating systems, such as time-sharing systems, may introduce an additional, intermediate level of scheduling. This medium-term scheduler is diagrammed. .
一些系统,例如分时系统,也许引进额外的中调度。中调度图片如下:
Addition of medium-term scheduling to the queueing diagram.
The key idea behind a medium-term scheduler is that sometimes it can be advantageous to remove a process from memory (and from active contention for the CPU) and thus reduce the degree of multiprogramming. Later, the process can be reintroduced into memory, and its execution can be continued where it left off. This scheme is called swapping
中调度的主要思想是:有时候从内存的进程池中移除一个进程是可以提高性能的,因为降低了多道程序的程度。在合适的时候,移除的进程可以再次调入内存中运行,而且可以继续在之前中断的地方开始。这一过程叫页面置换(swapping)。
Swapping may be necessary to improve the process mix or because a change in memory requirements has overcommitted available memory, requiring memory to be freed up.
在平均内存中两种进程(IO绑定和CPU绑定)的时候,或者内存需求大于实际可用的内存,要求释放依稀内存的时候,都会用到Swapping。