Operating systems do a thing called *time slicing.* This is where the OS gives each program a few milliseconds to run before the OS moves on to the next program. This is how the CPU is shared between many programs at the “same” time.
In most modern OSes, like Windows, this is a *premptive* process. That is, the OS doesn’t give the program the option to keep running, but instead, the OS has ultimate control over the CPU and decides who runs when.
When a program doesn’t respond to a “polite request” to give up its slice, the OS takes it anyway and marks the program as ‘not responding’. If the program fails to respond a certain number of times, the OS tells you so you can choose whether to give the program more time or to go ahead and kill & restart it.
Latest Answers