Practice free →
HomeGATE CSEcomputerscienceOperating Systems › Disabling INTERRUPTS as a way to implement mutua…

Disabling INTERRUPTS as a way to implement mutual exclusion on a single-CPU system is

Athe recommended approach for user-level mutexes
Bfine for short kernel sections, DANGEROUS for long ones
Cmore efficient than test-and-set on all architectures
Dan approach that scales to multi-CPU systems automatically
Answer & Solution
Correct answer: B. fine for short kernel sections, DANGEROUS for long ones
1. OSTEP §28.2 (Controlling Interrupts) discusses this approach. 2. By DISABLING interrupts, the kernel prevents any preemption. On single-CPU systems, this guarantees mutual exclusion (no other thread can run). 3. PROBLEMS: - LONG critical sections will lose timer ticks (time keeping breaks). - I/O interrupts are missed → device responses delayed. - User-mode code CANNOT disable interrupts (privileged). - Multi-CPU systems: disabling interrupts on one core does NOTHING about other cores. 4. So this approach is reserved for SHORT KERNEL critical sections only. 5. Options A, C, D have wrong characterisations. _Source: OSTEP Ch 28, §28.2 (Controlling Interrupts), p. 2-3._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions