Tänane küsimuste ja vastuste seanss jõuab meile viisakalt SuperUserini - Stack Exchange'i ja kogukonnapõhiste Q & A veebisaitide rühmitusse.
Foto viisakalt Matthias Ripp (Flickr).
Küsimus
SuperUseri lugeja ArunPrasanth tahab teada, kuidas Windows teab, et programm ei reageeri:
How does Windows know if a program is not responding? Does it constantly poll all running applications?
Kuidas Windows teab, kas programmid ei reageeri?
Vastus
SuperUseri panustaja põrkmehe freak on meie jaoks vastus:
An application gets events from a queue provided by Windows. If the application does not poll the event queue for a while (5 seconds), such as doing a long calculation for example, 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.
Kas teil on seletamiseks midagi lisada? Helistage kommentaarides. Kas soovite lugeda rohkem vastuseid teistelt tech-savvy Stack Exchange'i kasutajatelt? Tutvu täieliku arutelu teemaga siit.