Why does ending a task from task manager work better than canceling a program?

796 views

When a computer starts to freeze or operate slowly and doesn’t respond, ending the task(s) from the task manager usually ends the program and the problem. Why does this work better than simply canceling the task with ALT+F4/pressing the cancel button in the window?

In: Technology

26 Answers

Anonymous 0 Comments

A lot of programs have what is called “shutdown hooks” which is basically a piece of code that does something when you click Close or Alt-F4. The easiest example is the dialog you get when closing browser (“Do you want to close multiple tabs?”) or when closing Word or Excel (“Do you want to save your changes?”). When the program freezes it can get blocked completely so the hooks are waiting for the program to unfreeze which it never will so the program can’t close at all.

Ending the program in task manager bypasses all that and “kills” the process (think depriving it of resources). So it’s more effective in closing the applications but can result in unwanted things, i.e. losing changes, stuff not being saved to DB, connections not closing properly etc.

You are viewing 1 out of 26 answers, click here to view all answers.