Prev: VECTORCAST
Next: COMP.DSP 2010 conference update
From: Mel on 19 Mar 2010 08:42 David Brown wrote: > It seems strange that the AutoEndTask behaviour is not enabled by > default - if you ask the system to shut down, you want all the programs > to be stopped no matter what it takes. And forcefully killing them like > this is still much nicer than the reset or power button, which is the > only alternative. Windows likes to use shutdown as a time to make sure that all software updates are downloaded and installed. I think (not sure) lack of AutoEndTask is what lets this happen. Mel.
From: David Brown on 19 Mar 2010 09:50 On 19/03/2010 13:42, Mel wrote: > David Brown wrote: > >> It seems strange that the AutoEndTask behaviour is not enabled by >> default - if you ask the system to shut down, you want all the programs >> to be stopped no matter what it takes. And forcefully killing them like >> this is still much nicer than the reset or power button, which is the >> only alternative. > > Windows likes to use shutdown as a time to make sure that all software > updates are downloaded and installed. I think (not sure) lack of > AutoEndTask is what lets this happen. > > Mel. > You would think MS could figure out a way to distinguish software updates and hung processes... The inability to stop hung processes pre-dates windows system of updating software when you least expect it and least want it, but that may well be part of the reason.
From: George Neuner on 20 Mar 2010 00:39 On Fri, 19 Mar 2010 08:42:42 -0400, Mel <mwilson(a)the-wire.com> wrote: >David Brown wrote: > >> It seems strange that the AutoEndTask behaviour is not enabled by >> default - if you ask the system to shut down, you want all the programs >> to be stopped no matter what it takes. And forcefully killing them like >> this is still much nicer than the reset or power button, which is the >> only alternative. > >Windows likes to use shutdown as a time to make sure that all software >updates are downloaded and installed. I think (not sure) lack of >AutoEndTask is what lets this happen. Updates are actually installed at boot ... not at shutdown. However, the registry entries that control the install may be in flux at the time of the shutdown. George
From: George Neuner on 20 Mar 2010 02:33 On Fri, 19 Mar 2010 09:14:33 +0100, David Brown <david(a)westcontrol.removethisbit.com> wrote: > >It seems strange that the AutoEndTask behaviour is not enabled by >default - if you ask the system to shut down, you want all the programs >to be stopped no matter what it takes. And forcefully killing them like >this is still much nicer than the reset or power button, which is the >only alternative. It's not enabled by default because data can be lost when a process is forcibly terminated. Most people desire that only hung programs be killed, but AutoEndTasks will also kill programs that just happen to be busy when asked. >Is there any way to kill individual applications more forceably than can >be done with task manager (or process explorer, etc.)? i.e., can you >get the AutoEndTask effect but only apply it to one hung process without >shutting down the whole system? A sort of "kill -9" for windows. Yes: attach with "controlling process" access rights (i.e. as a debugger). See OpenProcess() and TerminateProcess(). Be aware that TerminateProcess() does not detach DLLs before killing the process, so shared DLLs may retain allocated state for the process, and if the DLLs implement COM/ActiveX objects their reference counts may be messed up until reboot. You have to own the process or be a member of the Administrator or SYSTEM group to get modify access rights on a process. FWIW: you don't need to write it yourself (though it is simple). There are a number of command-line and GUI "kill" programs for Windows ... M$ even provides one in its server tools distribution. George
From: David Brown on 20 Mar 2010 06:51
George Neuner wrote: > On Fri, 19 Mar 2010 09:14:33 +0100, David Brown > <david(a)westcontrol.removethisbit.com> wrote: > >> It seems strange that the AutoEndTask behaviour is not enabled by >> default - if you ask the system to shut down, you want all the programs >> to be stopped no matter what it takes. And forcefully killing them like >> this is still much nicer than the reset or power button, which is the >> only alternative. > > It's not enabled by default because data can be lost when a process is > forcibly terminated. Most people desire that only hung programs be > killed, but AutoEndTasks will also kill programs that just happen to > be busy when asked. > I'm not thinking that tasks should be killed instead of being asked to die, but that unresponsive tasks that refuse to die should be killed. The "AutoEndTask" behaviour should come automatically after normal shutdown processing has failed to work - the alternative is a hard reset which risks all sorts of mess because windows itself hasn't stopped properly (who cares if a hung process loses data?). > >> Is there any way to kill individual applications more forceably than can >> be done with task manager (or process explorer, etc.)? i.e., can you >> get the AutoEndTask effect but only apply it to one hung process without >> shutting down the whole system? A sort of "kill -9" for windows. > > Yes: attach with "controlling process" access rights (i.e. as a > debugger). See OpenProcess() and TerminateProcess(). > > Be aware that TerminateProcess() does not detach DLLs before killing > the process, so shared DLLs may retain allocated state for the > process, and if the DLLs implement COM/ActiveX objects their reference > counts may be messed up until reboot. > > You have to own the process or be a member of the Administrator or > SYSTEM group to get modify access rights on a process. > > FWIW: you don't need to write it yourself (though it is simple). There > are a number of command-line and GUI "kill" programs for Windows ... > M$ even provides one in its server tools distribution. > > George I'll give that a shot next time something has stuck beyond "normal" killing. It doesn't happen often, fortunately. |