CS FundamentalsHardProduct-company MCQ pattern
How many of the following statements about deadlock are correct? 1. Requiring a process to request all its resources at once prevents hold-and-wait but can lower resource utilisation. 2. Imposing a total order on resource types and requesting them only in increasing order prevents circular wait. 3. An unsafe state always means the system is deadlocked. 4. The Banker's algorithm needs each process to declare its maximum demand in advance.
- A. Only one
- B. Only two
- C. Only three
- D. All four
Correct answer: C. Only three
1, 2 and 4 are correct. 3 is false: an unsafe state only means deadlock is possible; processes may release resources before requesting their maximum, so it may never happen.
More Operating Systems questions
- 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)…
- A 64-bit machine uses 48-bit virtual addresses, 4 KB pages and 8-byte page-table entries. Every page table occupies exactly one page. How…