You are on page 1of 3

CS 143A Winter 2013

Quiz 2

4. In a resource allocation graph, a directed edge from 1. To get into a deadlock situation, we need to have: process Pi to resource type Rj means: a. Mutual exclusion AND hold and wait AND no a. Pi has requested an instance of Rj preemption AND circular wait b. Pi has requested all instances of Rj that are b. Mutual exclusion AND preemption AND available spooling everything AND ordering of c. None of the above resources numerically c. No preemption AND hold and wait AND 5. Let us consider two processes A and B and three ordering of resources numerically resource types R, S, and T. Let us consider that d. None of the above process A requests resource types R, S, and T, and process B requests resource types R and S. If 2. Given a system where all shared resource types are A gets assigned resource types R and T, and B numbered, if a process is ordering a resource of gets assigned resource type S, then: type N, it should not be holding a resource of type a. A and B will be in deadlock greater than or equal to N. This is a method for b. There is no deadlock deadlock. a. Prevention 6. Dynamic linking/loading is an example of delayed b. Detection binding: c. Recovery a. True d. None of the above b. False
3. Which of the following statements on resource allocation graphs is true: a. If there are no cycles, there is deadlock b. If there are cycles, there is deadlock c. If there are cycles, there is no deadlock None of the above

7.

In a certain system, N processes arrive at the CPU 9. ready queue at the same time. Which of the following scheduling algorithms will give the minimum average turnaround time of these N processes? a. First-Come, First Served b. Round-Robin c. Shortest-Job-First d. None of the above In the Banker's Algorithm, Need[i,j] + Allocation[i,j] = a.Available[i,j] b.Request[i,j] c.Max[i,j] d.None of the above

In First-Come, First-Served scheduling policy, I/O bound processes may have to wait long in the ready queue waiting for a CPU bound job to finish. This is known as

a. Aging
b. Priority inversion c. Priority inheritance d. Convoy effect e. None of the above

8.

10. A process P tries to acquire a lock using the Test_and_Set instruction: while (Test_and_Set(lock)) do no-op; If the lock is busy (some other process has acquired it) and all interrupts are disabled, then a. process P blocks, waiting for the lock to be available b. process P wastes processor and memory cycles

c. none of the above

You might also like