01 / 07
There is a queue
This Linux has one CPU. Which means only one program can truly run at a time.
But last lesson you ran three sleeps at once. How did that work?
it hands the turn round bit by bit (switching thousands of times a second)It is only too fast to see. Inside the kernel there is a queue, and something decides who moves next. That something is called the scheduler.
Normally everyone queues equally. But you will think this sometimes.
> this job is in no hurry, it can come later
The tool for saying so is nice. It makes something stand back in the queue.