Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why is it that ending a task in XP/Vista takes so much longer than ending the underlying process itself? WHat's the relationship between a task and a process from an OS perspective?

share|improve this question

migrated from stackoverflow.com Aug 10 '09 at 17:00

This question came from our site for professional and enthusiast programmers.

2 Answers 2

I believe ending the task requests the program to quit gracefully first, whereas ending the process is the Windows equivalent of SIGKILL - the OS just dumps the process with no questions asked.

share|improve this answer

"Task" is the term used by "Task Manager" to - justify its name - show the list of "main windows of the user's processes"(*), if any

"End Task" gives the "task" (message loop for the "main window") a last chance to react to the WM_CLOSE message and times-out on the associated process to finish.(http://blogs.msdn.com/oldnewthing/archive/2004/07/22/191123.aspx)

"End Process" is a rude TerminateProcess, discarding any pending changes to files or other resources.

Commonly, a mini-dump is created for a Microsoft Online Crash Analysis (Dr. Watson) report, which also might take a second or two.

(*) Raymond, I know this is so inaccurate.

share|improve this answer
    
Actually, I'm not sure that "end process" is that violent, it seems to wait a moment for the program to terminate anyway. It seems like, at least, since it takes more time, compared to Process Explorer (which is clearly not giving a chance and sending a "kill" command). Though I could be wrong, it's only a personal observation. –  Gnoupi Aug 10 '09 at 17:11
    
There is certainly a difference in the way end task behaves between process explorer and the standard WinTask Manager. I think process explorer has implemented the rudest method to terminate a running PID. –  Axxmasterr Aug 10 '09 at 17:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.