Note that I never said the scheduler is non-deterministic. It is the order of your threads' execution that's non-deterministic.
Note that I never said the scheduler is non-deterministic. It is the order of your threads' execution that's non-deterministic.
There are lots of schedulers out there that have a different contract than the one you described ("run threads in any order"). For example, many real-time systems run threads in priority order - you only get preempted if a higher-priority thread wants to run.
Imagine you spin off 10 threads waiting for network requests where one thread per client machine. It cannot be deterministically decided which thread will run first and which will run next. It depends on which client connects to which thread first. That's the non-deterministic nature of the program. Concurrency is the discipline to deal with that problem.