How the Scheduler Works in Xv6
Here’s an ELI5 (Explain Like I’m 5) version of what the scheduler() function in xv6 is doing: What is a scheduler? Imagine a classroom with a bunch of students (processes) but only one teacher (CPU). The teacher can only help one student at a time, so she needs a way to pick which student to help next. That’s what the scheduler does — it chooses which process gets to use the CPU next. ...