考虑以下用于防止具有互斥资源的系统中的死锁的策略。
I. Processes should acquire all their resources at the
beginning of execution. If any resource is not
available, all resources acquired so far are released.
II. The resources are numbered uniquely, and processes are
allowed to request for resources only in increasing
resource numbers.
III. The resources are numbered uniquely, and processes are
allowed to request for resources only in decreasing
resource numbers.
IV. The resources are numbered uniquely. A process is allowed
to request only for a resource with resource number larger
than its currently held resources.
以上哪些策略可以用来防止死锁?
(A) I 和 III 中的任何一个,但不包括 II 或 IV
(B) I、III 和 IV 中的任何一项但不包括 II
(C) II 和 III 中的任何一个,但不是 I 或 IV
(D) I、II、III 和 IV 中的任何一项答案: (D)
说明:如果遵循 Ist,则永远不会发生保持和等待。
II、III和IV类似。如果遵循这些中的任何一个,将无法进行循环等待。
这个问题的测验