How multithreading works [closed]

This depends on both your hardware and on your OS. If you have fewer cores than threads then the OS will likely interleave those threads, that is, every time one of them performs for example an IO operation or every time it finishes its time slice it gets switched for a different thread.

Also, every core runs one thread of execution. That’s what multiple cores are for. This is usually mixed with the time slicing behavior.

Browse More Popular Posts

Leave a Comment