Posted By: Massif | Aug 21st @ 1:21 AM
page 1 of 1
Comments: 15 | Views: 511
Massif
Massif
aim stupidly high, expect to fail often.

This may have been approached in a video somewhere, but I thought I ask actual people instead of trawling through hours of footage to find a possible answer.

 

When I log off / shut down - how does windows decide which order to shut down applications in? I originally assumed it just sent the same shutdown message to all applications. But is it smarter than that? Does it send large applications shutdown messages early? Does it only try to shut down N processes at a time. (Where N is the number of processors the machine has.)

 

Just idle curiosity really.

Windows just starts sending every app a WM_QUERYENDSESSION message then, assuming nothing attempts to block shutdown, sends everything an WM_ENDSESSION message. Apps have to respond in a timely fashion to these messages or Windows will just kill them The end result of this is that there is no defined order of apps shutting down and you should never ever try to rely on one.

 

 

W3bbo
W3bbo
The Master of Baiters

How is it that when logging off or shutting down Windows can really kill a process, yet no amount of taskkill /f will stop some unrulely processes?

blowdart
blowdart
Peek-a-boo

Because Windows runs at a higher privilege level than any user ever can.

 

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

One of the "nice" things about Linux is that a process can get in a state where it truly can't be killed, even by the system. In this situation, you cannot even shut down because even that will get stuck trying to kill these processes. The only way out is a hard reset.

Dodo
Dodo
I'm your creativity creator™ :)

That 'hard reset', can be triggered via software with sufficient privilegues at any given time.

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

Yes, I know, the SysRq key sequences that you can also trigger using some file in /proc somewhere. It's still rather rediculous that a user-mode process can get the system in such a state that it cannot be cleanly shut down.

Windows has similar "you can't kill this process" issues.  Typically they're related to buggy drivers that can't cancel I/O's properly (before a thread can be terminated all the I/O that's outstanding on that thread has to be canceled and if a driver hangs on cancelation (or fails to handle cancelation properly) the thread can't be stopped (or the machine would bluescreen when the I/O finally did complete).

 

There are WHQL tests to verify that 3rd party WHQL signed drivers properly handle cancelation but there are buggy non WHQL signed drivers that can cause this to happen.

 

blowdart
blowdart
Peek-a-boo

What do the WHQL tests do? It's nice to find out something, but having dealt with Nvidia's drivers which are WHQL certified, and yet as buggy as sin I've often wondered what is actually tested.

The problem with WHQL tests is that it's very easy to submit a driver and have it pass all the quality tests, then package that signed driver in an installer that adds a bunch of registry keys that cause the driver to switch into an "optimized" mode that would never have passed the tests.

blowdart
blowdart
Peek-a-boo

Which raises the question "What's the point?"

ManipUni
ManipUni
Proving QQ for 5 years!

Better quality drivers.

Exactly, it doesn't really amount to much, but there's no real way around that. If manufacturers are prepared to game the system, they'll always find away to get around the quality testing. The hope, I guess, is that the mere existence of the tests is enough to encourage some developers to raise their standards.

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

But when that happens, does it also become impossible to reboot or shut down the system? I've had unkillable processes on Windows, but I've never had them so unkillable that the system couldn't be shut down anymore. That's what happened to me on Linux.

page 1 of 1
Comments: 15 | Views: 511
Microsoft Communities