It’s time to act like a CPU to help you solve a real-life problem. It’s Saturday morning at 9 a.m. Your parent/guardian says that if you and your two siblings get all your chores done by 1 p.m., you can go to the pool for the rest of the afternoon. How will you dole out the chores to make sure they can all get done in time? Each person can only be doing one chore at a time, and some chores have a waiting time before you can do them again (e.g., you can’t do a load of laundry while your siblings is still running!).
Here are the chores that need to be completed by you and your two siblings:
Each of you needs to sort and start a load of laundry. This takes 30 minutes to do, and the washer is unavailable for the next 30 minutes while it runs.
Clean two bathrooms: 1 hour each
Cut the grass: 1 hour
Clean the kitchen: 1 hour
Each of you needs to clean their bedroom: 30 minutes each
Vacuum and sweep floors: 1 hour, 30 minutes
Dust: 30 minutes
Mop floors: 1 hour, 30 minutes; this has to happen sometime after vacuuming/sweeping
Scoop cat's litter box and walk the dog: 30 minutes total
Can you come up with a schedule for how to work with your siblings to finish these chores by 1 p.m. so you can go swimming?
This type of thinking is similar to the work the OS and CPU do together to ensure all the computer’s tasks get finished and that each program gets the time they need using the CPU to execute their instructions.