Dnešná relácia otázok a odpovedí sa k nám pridelí zdvorilosťou SuperUser - podskupiny Stack Exchange, skupín webových stránok týkajúcich sa otázok a odpovedí.
Foto je s láskavým dovolením Matthias Ripp (Flickr).
Otázka
Čítačka SuperUser ArunPrasanth chce vedieť, ako systém Windows vie, že program nereaguje:
How does Windows know if a program is not responding? Does it constantly poll all running applications?
Ako systém Windows vie, či programy nereagujú?
Odpoveď
Príspevok SuperUser ratchet freak má odpoveď pre nás:
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.
Máte niečo doplniť vysvetlenie? Znížte komentáre. Chcete si prečítať viac odpovedí od iných používateľov technológie Stack Exchange? Pozrite sa na celý diskusný príspevok tu.