Operating Systems
Lesson 2 of 2 9 min +50 XP

Scheduling & Virtual Memory

Sharing the CPU and pretending memory is endless.

What you'll learn

  • Compare scheduling policies
  • Explain virtual memory
  • Describe paging
Turns on the swing, and the endless bookshelf

The OS gives each program short turns on the CPU like kids sharing a swing (scheduling), and hands each one a private, seemingly-endless memory space (virtual memory) even though the real RAM is small and shared. Both are clever illusions of plenty.

Fair turns and roomy memory

A scheduler decides which ready process runs next. Round-robin gives each a small time slice in turn (fair); priority scheduling runs important work first (but can starve the rest). Virtual memory gives each process the illusion of a huge private memory; the OS maps virtual pages to real RAM and parks extra pages on disk.

  • Round robin: equal time slices, rotated — simple and fair.
  • Priority: important tasks first — responsive, but risks starvation.
  • Paging: memory split into fixed pages, mapped from virtual to physical.
Lab · Schedule three jobs
  1. You have jobs A, B, and C, each needing 3 time slices.
  2. Write the run order under round-robin with a 1-slice quantum.
  3. Now give C top priority and write the priority order.
  4. Explain one downside of the priority schedule for A and B.

What you should see: You compared round-robin and priority scheduling and saw the fairness/starvation trade-off.

Knowledge Check

+15 XP / correct

1. Round-robin scheduling gives each process…

2. Virtual memory lets each process act as if it has…