Windows – How does Windows know if a program is not responding

windows

How does Windows know if a program is not responding? Does it constantly keep polling all running applications?

Best Answer

An application gets the events from a queue provided by Windows.

If the application doesn't poll the eventqueue for a while (5 seconds), for example when doing a long calculation, then Windows assumes that the application is hung and alerts the user.

To avoid that applications should push expensive calculations to worker threads or split up processing and make sure the queue gets polled regularly.

Related Question