CS FundamentalsModerateGATE CS
Which condition makes disabling interrupts an INSUFFICIENT way to implement a critical section?
- A. The machine has multiple processors
- B. The critical section is very short
- C. The program runs in kernel mode
- D. There is only one process
Correct answer: A. The machine has multiple processors
Disabling interrupts on one CPU stops preemption there, but code on other CPUs can still enter the critical section. It also must not be allowed in user mode.
More Operating Systems questions
- Two threads run on different cores. Thread 1: data = 42; ready = 1; Thread 2: while (!ready); print(data); Both variables are plain…
- How many of these statements about the critical-section problem are correct? 1. Progress means only processes not in their remainder…
- 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…