CS FundamentalsHardGATE CS
How many of these statements about the critical-section problem are correct? 1. Progress means only processes not in their remainder section take part in deciding who enters next, and the decision cannot be postponed indefinitely. 2. Bounded waiting limits how many times others may enter before a requesting process does. 3. Strict alternation (turn variable only) satisfies progress. 4. Peterson's solution works for any number of processes without change.
- A. 3
- B. 1
- C. 4
- D. 2
Correct answer: D. 2
1 and 2 are the standard definitions. Strict alternation fails progress (a process can be blocked by one in its remainder section), and Peterson's algorithm as given is for two processes; n processes need a generalisation such as the filter or bakery algorithm.
More Operating Systems questions
- In Lamport's bakery algorithm, why does a process pick a number with number[i] = max(number) + 1 while choosing[i] is true, and break ties…
- A barrier for N threads is implemented with count (protected by mutex) and a semaphore barrier = 0: each thread does lock; count++; if…
- Processes (arrival, burst): P1 (0, 12), P2 (2, 4), P3 (3, 6), P4 (8, 5), P5 (10, 2). Under SRTF, which process waits the longest, and for…
- Processes (arrival, burst): A (0, 5), B (1, 7), C (3, 2), D (4, 6). Round Robin with quantum 4 (new arrivals queued before a preempted…
- Processes (arrival, burst, priority; smaller number = higher priority): P1 (0, 3, 2), P2 (1, 6, 1), P3 (2, 4, 3), P4 (12, 2, 1), P5 (13…
- Processes (arrival, burst): A (0, 6), B (2, 6), C (5, 9), D (5, 8), E (5, 2). Under non-preemptive HRRN, what is the average waiting time?