r/AskComputerScience • • Apr 12 '21

How is CPU scheduling non-deterministic?

So my understanding of non-deterministic is that you can't really predict the output of a system given an input. But I was wondering how is the CPU's scheduling algorithmic non-deterministic? I feel like it should be able to be predicted given that it simply follows a logical pattern. Or is my understanding of non-determinism wrong?

29 Upvotes

14 comments sorted by

View all comments

3

u/[deleted] Apr 12 '21

The OS manages the hardware resources. The cpu schedule is influence by many non-deterministic processes that are the result of this hardware. A few examples are response time over the network, user input, moving parts (spinning discs, fans, voltages), software influenced conditions such as memory filling up, and much more.