请解释暂停过程的以下特征

Please explain the following characteristic of suspended process

以下内容来自 William Stallings "Operating systems, internals and design principles",他在其中解释了挂起进程的特征

The process may or may not be waiting on an event. If it is,this blocked condition is independent of the suspend condition, and occurrence of the blocking event does nor enable the process to be executed immediately.

这点我没看懂,什么是blocked condition和suspend condition? 有人可以解释一下吗?

The process may or may not be waiting on an event. If it is,this blocked condition is independent of the suspend condition, and occurrence of the blocking event does nor enable the process to be executed immediately.

让我们假设你已经挂起的进程是进程A,它接受来自客户端套接字的传入请求(称之为事件接受连接请求)。所以,这本质上是一个阻塞调用。并且,假设此进程已被用户(/系统)挂起;而且,它本质上也是阻塞的。

因此,即使客户端将请求传递给该进程,从而结束该进程的阻塞状态;尽管如此,由于进程处于挂起状态,该进程不会进一步执行。因此,即使客户端传递了请求,但服务器不会响应,因为它被挂起,尽管阻塞的原因已被客户端传递请求无效。

一旦取消暂停,进程将开始执行并接受客户端请求。

因此,即使已经为进程提供了阻止原因,也必须将进程从挂起中撤回,以使其能够继续进行。

此外,来自 Process management (computing) on Wikipedia :

A process can be suspended from the RUNNING, READY or BLOCKED state, giving rise to two other states, namely, READY SUSPEND and BLOCKED SUSPEND.

挂起的 运行 进程变为 READY SUSPEND,

and a BLOCKED process that is suspended becomes BLOCKED SUSPEND. A process can be suspended for a number of reasons; the most significant of which arises from the process being swapped out of memory by the memory management system in order to free memory for other processes. Other common reasons for a process being suspended are when one suspends execution while debugging a program, or when the system is monitoring processes.

... A process in the SUSPEND BLOCKED* state is moved to the SUSPEND READY state when the event for which it has been waiting occurs.

* 请注意,SUSPEND BLOCKED 状态和 BLOCKED SUSPEND 状态被认为是相同的。

挂起的进程是指已关闭的进程。该进程存在但未安排执行。例如,假设您有一台服务器,您想要 运行 一个 CPU 密集型分子建模程序,需要两个月才能完成 运行ning。白天,当每个人都在工作时,您不希望程序占用 CPU。每天早上暂停进程,晚上取消暂停。

当进程被阻塞时,它正在等待某些事情发生以允许它继续(即 I/O 完成)。

当进程挂起时,它正在等待某人取消挂起。正如文本所指出的,一个进程既可以被阻止也可以被挂起。

  1. 从主内存换回辅助内存
  2. Most 可能正在等待事件发生很长时间
  3. 非常浪费 cpu 个周期
  4. 通过代理发送到此状态:本身,通过 os,通过父进程。
  5. 一旦发生事件或来自代理的信号,它将被交换回主内存以执行。

当发生中断时,正在运行的进程可能会被挂起。当进程发出 I/O 请求时发生中断。该进程需要输入设备或输出才能完成执行,该进程将暂停,直到请求的设备准备好满足进程的请求。