Preemptive vs Non-Preemptive Scheduling — Concept Check
Questions on Preemptive vs Non-Preemptive Scheduling. Non-preemptive scheduling lets a process run until it voluntarily yields; preemptive scheduling allows the OS to forcibly interrupt a running process via a timer interrupt, enabling better responsiveness but requiring synchronization.
Questions in this quiz
8 questions on Preemptive vs Non-Preemptive Scheduling — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A process in a non-preemptive scheduling environment enters an infinite loop. What is the likely outcome?
- AThe process will be terminated automatically by the OS.
- BThe process will yield the CPU after a fixed time slice.
- CThe process will monopolize the CPU indefinitely.
- DThe OS will preempt the process after a timeout.
2.In a preemptive scheduling system, what happens when a timer interrupt occurs?
- AThe current process voluntarily yields the CPU.
- BThe OS immediately terminates the current process.
- CThe current process continues running without interruption.
- DThe OS checks if the current process has exhausted its time slice.
3.A Java application using virtual threads is experiencing delays. What could be a reason?
- AVirtual threads monopolize the CPU indefinitely.
- BVirtual threads yield only at blocking points, causing potential delays.
- CVirtual threads are not supported in Java 21.
- DVirtual threads are preemptively scheduled, causing delays.
4.Which of the following is true about preemptive scheduling?
- AIt allows processes to run indefinitely without interruption.
- BIt eliminates the need for synchronization mechanisms.
- CIt is simpler to implement than non-preemptive scheduling.
- DIt can interrupt a process at any instruction, requiring synchronization.
5.A developer claims that preemptive scheduling is used in all modern operating systems. Is this correct?
- ANo, modern OS use a mix of preemptive and non-preemptive scheduling.
- BYes, but only in Linux and macOS.
- CNo, modern OS use only non-preemptive scheduling.
- DYes, all modern OS use preemptive scheduling.
6.What is a potential issue with non-preemptive scheduling?
- AIt interrupts processes at any instruction, causing race conditions.
- BProcesses can monopolize the CPU if they do not yield.
- CIt requires complex synchronization mechanisms.
- DIt is not supported by any modern operating system.
7.A process is frequently yielding the CPU using Thread.yield() in a Java application. What is the effect?
- AThe process will run faster due to frequent yielding.
- BThe process will be terminated for excessive yielding.
- CThe process hints the scheduler to give CPU time to other threads.
- DThe process will block indefinitely waiting for CPU time.
8.In a preemptive system, a long-running process is not yielding the CPU. What will happen?
- AThe OS will terminate the process for not yielding.
- BThe process will yield the CPU voluntarily after some time.
- CThe process will run indefinitely without interruption.
- DThe OS will preempt the process after its time slice expires.