What is it exactly that "triggers" Windows to mark a process as Not responding in the Task Manager and Resource Monitor?
The API behind this is IsHungAppWindow. Basically, if the application has not pumped a message within 5 seconds it can be marked as not responding.
If a process does not collect Windows messages from its queue using the GetMessage
function or something related, it will be tagged as "not responding" -- because it is not responding to user interface events.
This does not necessarily mean that the application is actually hung -- it may just be too busy to pay attention to the user.
Basically, it get's it self into a state where the program does not return to a point where it can process it's message queue.
Usually, this is either a loop that doesn't end or a blocking operation, such as reading from a socket, etc.
The fact that they don't empty their message queue, by polling it GetMessge API and the like.