- LPU MCA Semester 1
- CAP366
- Unit 3
CAP366 · Unit 3: Process management
Process scheduling: queues and schedulers
10 practice questions · in the MTE and ETE syllabus
Key points
- Ready queue holds processes waiting for the CPU
- Long-term controls degree of multiprogramming
- Medium-term swaps
- Short-term runs most often and must be fast
Processes move among queues: the job queue (all processes), the ready queue (in memory, waiting for the CPU) and device queues (waiting for an I/O device).
| Scheduler | Role | Frequency |
|---|---|---|
| Long-term (job) | Admits jobs to memory; controls degree of multiprogramming | Rare |
| Short-term (CPU) | Picks the next ready process | Very frequent (ms) |
| Medium-term | Swaps processes out and back in | Occasional |
A good long-term mix has both I/O-bound and CPU-bound processes so CPU and devices stay busy. UNIX and Windows have no long-term scheduler: new processes go straight to memory.
Example: if the short-term scheduler takes 10 ms and the process then runs 100 ms, overhead is 10 / 110 = 9.1 percent.
Exam pitfall: the dispatcher is not the scheduler: the scheduler decides, the dispatcher hands over the CPU. The short-term scheduler must be fast.
Try two questions
Which statement correctly contrasts the long-term and short-term schedulers?
- The long-term scheduler sets the degree of multiprogramming and runs rarely, while the short-term one runs often
- The long-term scheduler picks the next process for the CPU, while the short-term picks jobs from disk
- The short-term scheduler controls the degree of multiprogramming and runs rarely
- Both run at the same frequency but manage different regions of memory
Show the answer
A. The long-term scheduler admits jobs into memory and so sets the degree of multiprogramming. The short-term scheduler dispatches the CPU frequently.
Why not B: These roles are reversed.
Why not C: The short-term scheduler runs every few milliseconds and does not admit jobs.
Why not D: Their frequencies differ greatly; they differ in purpose, not memory region.
The ready queue holds only CPU-bound jobs while the I/O devices sit idle. Which action best fixes the imbalance?
- The short-term scheduler should lengthen its quantum so CPU-bound jobs finish sooner
- The medium-term scheduler should swap out every I/O-bound job to disk
- The long-term scheduler should admit a better mix of I/O-bound and CPU-bound jobs
- The dispatcher should skip the context switch so jobs run longer
Show the answer
C. Choosing a balanced mix of I/O-bound and CPU-bound jobs is the long-term scheduler's job, and it keeps both CPU and devices busy.
Why not A: A longer quantum leaves the devices idle even longer.
Why not B: Removing I/O-bound jobs would worsen the imbalance.
Why not D: Skipping switches does not create I/O activity, and it breaks multitasking.