CS FundamentalsHardProduct-company MCQ pattern
Process L (low priority) holds a lock that high-priority process H needs. Medium-priority process M, which does not need the lock, becomes ready and preempts L. What is this situation called, and what fixes it?
- A. Priority inversion; fixed by priority inheritance (L temporarily runs at H's priority)
- B. Deadlock; fixed by the Banker's algorithm
- C. Convoy effect; fixed by Round Robin
- D. Starvation; fixed by aging
Correct answer: A. Priority inversion; fixed by priority inheritance (L temporarily runs at H's priority)
H is effectively blocked by M, a lower-priority process: priority inversion. With priority inheritance, L inherits H's priority while holding the lock, so M cannot preempt it; L releases the lock quickly and H runs.
More Operating Systems questions
- Consider this loop: c for (int i = 0; i < 2; i++) { fork(); printf("-"); } stdout is redirected to a file (fully buffered) and no fflush…
- Which CPU scheduling algorithm can make a long process wait indefinitely if short processes keep arriving?
- Which part of the operating system selects which process in the ready queue gets the CPU next?
- Processes (arrival, burst): P1 (0, 4), P2 (1, 3), P3 (2, 6), P4 (4, 2). What is the average turnaround time under FCFS?
- Reference string: 1, 3, 0, 3, 5, 6, 3, 1, 0, 6, 5, 3. With 3 frames, initially empty, how many page faults does FIFO replacement cause?
- Pure paging (fixed-size pages and frames) can suffer from which kind of fragmentation?