1. LPU MCA Semester 1
  2. CAP366
  3. 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).

SchedulerRoleFrequency
Long-term (job)Admits jobs to memory; controls degree of multiprogrammingRare
Short-term (CPU)Picks the next ready processVery frequent (ms)
Medium-termSwaps processes out and back inOccasional

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

Question 1 · Tier 2, Understand

Which statement correctly contrasts the long-term and short-term schedulers?

  1. The long-term scheduler sets the degree of multiprogramming and runs rarely, while the short-term one runs often
  2. The long-term scheduler picks the next process for the CPU, while the short-term picks jobs from disk
  3. The short-term scheduler controls the degree of multiprogramming and runs rarely
  4. 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.

Question 2 · Tier 4, Analyse

The ready queue holds only CPU-bound jobs while the I/O devices sit idle. Which action best fixes the imbalance?

  1. The short-term scheduler should lengthen its quantum so CPU-bound jobs finish sooner
  2. The medium-term scheduler should swap out every I/O-bound job to disk
  3. The long-term scheduler should admit a better mix of I/O-bound and CPU-bound jobs
  4. 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.