CS FundamentalsHardProduct-company MCQ pattern
A system has 6 identical tape drives. Each of n processes needs at most 2 drives. What is the maximum n for which the system is guaranteed to be deadlock-free?
- A. 3
- B. 5
- C. 4
- D. 6
Correct answer: B. 5
Deadlock-free if n(2 − 1) + 1 ≤ 6, i.e. n ≤ 5. With 6 processes each could hold 1 drive and wait for a second with none left. Dividing 6 by 2 to get 3 is the common mistake.
More Operating Systems questions
- How many of the following statements about deadlock are correct? 1. Requiring a process to request all its resources at once prevents…
- Semaphores S = 1 and T = 0. Process X runs: wait(S); print('A'); signal(T); Process Y runs: wait(T); print('B'); signal(S); Each runs its…
- Two threads each run the loop for (i = 0; i < 5; i++) count++; on a shared int count = 0, with no synchronisation. count++ is compiled to…
- How many times is "x" printed? (fork() returns 0 in the child and a positive PID in the parent; assume it always succeeds.) c int main() {…
- How many times is "x" printed? (Assume every fork() succeeds.) c int main() { fork(); fork() || fork(); printf("xn"); return 0; }
- How many lines are printed in total? (Assume every fork() succeeds.) c int main() { for (int i = 0; i < 3; i++) { if (fork() == 0)…