请考虑以下策略,以防止在具有互斥资源的系统中出现死锁。
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相似。如果遵循这些方法中的任何一个,则将无法进行循环等待。
这个问题的测验