Overview
Welcome back to elementary school! You'll complete math worksheets under different scheduling system constraints to experience how CPUs schedule tasks.
3 Stages:
- Batch System - Focus on throughput (FCFS scheduling)
- Interactive System - Focus on responsiveness (Round Robin scheduling)
- Real-Time System - Focus on deadlines (EDF scheduling)
You'll feel the frustrations of context switching, deadline pressure, and coordination overhead firsthand!
Learning Objectives
- Experience the priorities of Batch, Interactive, and Real-Time systems
- Understand FCFS, Round Robin, and EDF scheduling algorithms
- Feel the impact of time quanta, deadlines, and context switching
- Compare throughput vs responsiveness vs deadline constraints
Materials Needed
- Simple math worksheets (printed, 1-2 reams worth)
- Writing utensils (different colors per student if possible)
- Timer and bell/alert system
- 4 collection buckets (one per team)
Where to Find Worksheets
Any simple math worksheets will work! Choose something easy enough to be fast-paced but challenging enough to keep things manageable.
Recommended resource: Super Teacher Worksheets
Activity Structure
This activity has 3 stages (~15 minutes each):
- Stage 1: Batch System - Maximize throughput with FCFS scheduling
- Stage 2: Interactive System - Maximize responsiveness with Round Robin
- Stage 3: Real-Time System - Meet deadlines with EDF scheduling
After each stage: count scores, reflect, and discuss!
Be the first to set the record!
Complete this activity and add your class stats to the leaderboard.
Setup Instructions (For Instructor)
- Divide the class into 4 equal teams (by classroom location - quadrants work well)
- Give each student a writing utensil (different colors if possible)
- Set up 4 collection buckets (one per team)
- Print plenty of worksheets (at least 50-100, depending on class size)
- Prepare timer and bell/alert system
You'll act as the scheduler controlling task distribution!
Stage 1: Batch System (~15 minutes)
Goal
Maximize throughput - Complete as many worksheets as possible!
Batch systems prioritize getting the most work done in the least time. High hardware utilization, high job throughput, minimal restrictions.
Algorithm: First-Come, First-Served (FCFS)
You (the instructor) are the scheduler. Students are "CPU cores" executing tasks.
How It Works
- Students come to you (the scheduler) to receive a worksheet
- You hand them the next worksheet in the queue (FCFS order)
- Students return to their seats and complete the worksheet
- When done, they bring it back to you for quality check
- If correct → add to team's bucket and they get another worksheet
- If incorrect → return it to fix, then resubmit
Rules
You MUST:
- Work individually on your worksheet
- Get your own worksheets from the instructor
- Complete all problems correctly (no rushing!)
- Submit to the instructor yourself
You CANNOT:
- Have teammates write for you (but you can talk and ask for help!)
- Have someone else get/submit worksheets for you
- Skip problems or cut corners (incomplete work = no points)
You CAN:
- Talk, chat, have fun, get loud, move around!
Instructor Notes
You can adjust the activity to show interesting patterns:
- Pre-sort jobs by difficulty
- Offer choices between easy/hard worksheets
- Vary worksheet complexity to simulate different burst times
Stage 2: Interactive System (~15 minutes)
Goal
Maximize responsiveness - Make progress on many jobs at once!
Interactive systems prioritize making the device feel "snappy" and responsive. Less focus on overall throughput, more focus on ensuring all jobs make progress.
Algorithm: Round Robin (with role rotation!)
You (the instructor) control the time quanta with a bell.
New Roles
Teams now have two roles:
- Workers - Stay seated, complete worksheets
- Runner - Collects/submits work, distributes new worksheets (CANNOT work on worksheets!)
How It Works
- Before the bell: Workers work on their current worksheet. Runner manages getting new work from you and collecting completed work to submit.
- When the bell rings: Two things happen simultaneously:
- All workers pass their current worksheet to the next worker (counter-clockwise recommended)
- Roles rotate - runner becomes a worker, next worker becomes runner
- Repeat until stage time is up!
Rules
As a Worker:
- Only work on the worksheet currently in front of you
- Stay seated
- Pass your worksheet when the bell rings (even if incomplete!)
- When you become runner, immediately stop working
As a Runner:
- Manage your team's workflow
- Get new worksheets from instructor
- Submit completed work to instructor
- CANNOT work on any worksheets yourself
- When bell rings, become a worker
Everyone:
- No cutting corners - quality still matters!
- Can talk, chat, and coordinate!
Instructor Notes
- Vary the time quanta! Try 2 minutes, then 1 minute, then 30 seconds
- Shorter quanta = more context switching overhead
- Observe the multi-colored worksheets - visual evidence of context switching!
Stage 3: Real-Time System (~15 minutes)
Goal
Meet deadlines - Complete work before the deadline, or lose points!
Real-time systems prioritize meeting deadlines over throughput or responsiveness. Used in critical applications where "late" = "failure".
Algorithm: Earliest Deadline First (EDF)
You (the instructor) control deadlines with a bell. Teams self-schedule!
How It Works
- At the start: Divide all worksheets into 4 equal piles, give one pile to each team
- Teams self-organize: Groups decide how to distribute work among themselves
- Bell signals deadline reached: Everyone STOPS immediately
- Scoring:
- Completed worksheets = points
- Incomplete worksheets = negative points ⚠️
- Next work period begins - repeat!
Rules
You MUST:
- Stop working immediately when the bell rings
- Accept negative points for incomplete work
You CANNOT:
- Cut corners - quality still matters!
You CAN:
- Distribute work however you want within your team
- Swap worksheets with teammates as desired
- Self-manage submission and collection
- Talk, strategize, coordinate, and have fun!
Strategy Considerations
Teams might:
- Sort worksheets by difficulty (schedule easy ones first)
- Assign multiple worksheets per person
- Risk incomplete work to attempt more points
- Play it safe and only take what they can finish
Instructor Notes
- Vary deadline lengths! Try 5 minutes, then 3 minutes, then 2 minutes
- Negative points create real urgency - just like missing a deadline in embedded systems!
- Watch teams balance risk vs safety
Discussion Questions
After all stages are complete, gather everyone and discuss these questions. Connect student experiences back to hardware/software concepts!
Batch System Reflection
Interactive System Reflection
Real-Time System Reflection
Final Thoughts
Key Takeaways
Batch Systems (FCFS):
- ✅ Simple, straightforward
- ✅ Maximizes throughput when jobs are similar
- ❌ Can suffer from convoy effect (long jobs block short ones)
- ❌ Poor responsiveness
Interactive Systems (Round Robin):
- ✅ Fair - everyone makes progress
- ✅ Feels responsive even if slower overall
- ❌ Context switching overhead (those different colored pens!)
- ❌ Lower throughput than batch systems
Real-Time Systems (EDF):
- ✅ Guarantees deadlines (when possible)
- ✅ Optimal among deadline-based schedulers
- ❌ Requires predictable job lengths
- ❌ Failure = catastrophic (negative points = danger!)
Grading
Participation-based - No winner or loser! Just engage, strategize, and participate in the discussion.
Alternate Assignment (For Absences)
Couldn't make it to class? You can make up the points by completing this alternate assignment!
Watch This Video
Watch this excellent video from Core Dumped about CPU scheduling. George explains scheduling algorithms and their trade-offs beautifully.
While watching, keep the 3 system types in mind: Batch, Interactive, and Real-Time.
Video: The Fancy Algorithms That Make Your Computer Feel Smoother
Answer These Questions
Submit a PDF with your answers to Brightspace:
Submission: Upload your PDF to the relevant Brightspace assignment.