class: title # CPU Scheduling ## CSC 213 – October 5, 2026 --- # Agenda for Today 1. Department Events 1. Upcoming Work 1. CPU Scheduling 1. Wrap Up --- # Department Events ## Panel: AI and the Future of Democracy .indent[ Monday, October 5th at 4:15pm in HSSC S1325 Robert Gehorsam ‘76, Lorelei Kelly ’88, Toby Cain ‘12, and Bruce Schneier ] ## CS Table: Google Zero .indent[ Tuesday, October 6th at noon in the CS Commons ] ## Washington University Dual Degree Presentation *(no tokens)* .indent[ Tuesday, October 6th at 7pm in Noyce 1023 Learn about the WashU 3–3 Engineering program and their MS programs. ] ## CS Welcome Session *(tokens for non-majors only)* .indent[ Thursday, October 8th at 4pm in Noyce 3821 ] *To receive a token, send an email to let me know you attended no more than 48 hours after the event.* --- class: section, blue # Upcoming Work --- # Assignment: Listing Directories **Due:** Wednesday, October 7th by 11:59pm **Late Deadline:** Friday, October 9th by 10:00am ## Questions _No new questions since last class._ --- # Lab: Malloc **Due:** Wednesday, October 7th by 11:59pm **Late Deadline:** Monday, October 12th by 11:59pm ## Questions _No new questions since last class._ --- # Assignment: Week 6 **Due:** Monday, October 12th by 11:59pm **Late Deadline:** Wednesday, October 14th by 10:00am This will not be a coding assignment. Instead, you'll answer some questions related to the filesystem discussion we ended with on Friday last week. The assignment will be posted by the end of the day today. --- class: section, blue # CPU Scheduling --- # Discussion: Scheduling Basics **Questions for think, pair, share:** 1. Why does the OS have a scheduler, and what does it do? 2. What do each of these terms mean in the context of CPU scheduling? - Batch Scheduling - Preemption - Quantum - Context Switch *Start by thinking of answers on your own. I will let you know when to start discussion.* --- # Discussion: Basic Scheduling Algorithms The textbook introduced four simple scheduling algorithms. Answer the following questions about these algorithms: 1. What are the four scheduling algorithms? 2. For each algorithm, how does it choose the next task to run? 3. Which of these scheduling algorithms are preemptive? *Start by thinking of answers on your own. I will let you know when to start discussion.* --- # Discussion: Evaluating Schedulers **Questions for think, pair, share:** 1. How can we measure a scheduler's performance? Think of at least two ways. 2. For each measurement you identified in question 1, what is the impact when the scheduler does well? What if it does poorly? Try to think of specific examples. *Start by thinking of answers on your own. I will let you know when to start discussion.* --- # Scheduling a Sample Workload What will FIFO, SJF, STCF, and RR (with a 2ms quantum) do with this workload? - Job A arives at time 0ms and runs for 4ms - Job B arrives at time 1ms and runs for 2ms - Job C arrives at time 3ms and runs for 1ms Calculate response time and turnaround time for each schedule. *You may work on your own or collaborate with neighbors to answer these questions.* --- class: section, blue # Wrap Up --- # Reminders ## Upcoming Deadlines - **Malloc Lab:** due this Wednesday, or next Monday with a token - **Listing Directories Assignment:** due this Wednesday, or Friday morning with a token ## Need help? Use your resources! - Book an appointment during office hours - Attend mentor office hours - Review slides, readings, and other course resources - Use tools like `gdb` and AddressSanitizer to catch and diagnose issues ## Reading - **Review lab before class**