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

618 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

Clicking the X button or pressing alt+F4 is asking a program to close. It may do it but it can also ignore it if doesn’t feel like it, or can’t do it.
You just inform the program , that you’d like to end, but it’s up to it what it’ll do with that knowledge.

Task manager just straight up kills the app without even asking.

Anonymous 0 Comments

What others said. Plus a note that it’s architectonic decision to make it this way. There is nothing stopping us from executing kill command right after you softly press that X in the corner. But the consensus so far has been that it’s not a good idea.

Anonymous 0 Comments

Clicking the “X”-Button is like reading a bedtime story, tucking them in and kissing your child goodnight.

Terminating a task in the task manager is like just knocking them out without them remember anything about the day before in the morning.

Anonymous 0 Comments

If you want a fun story with a small amount of technical data get it right from Dave’s mouth as in the guy who literally wrote the bulk of the original task manager code. He has a YouTube channel called Dave’s garage and has a 3 piece series on the history of TM.

[https://www.youtube.com/watch?v=f8VBOiPV-_M&t=3s](https://www.youtube.com/watch?v=f8VBOiPV-_M&t=3s)

Anonymous 0 Comments

Close command has to be processed by the program. It has to finish processing whatever it’s stuck on before handling it.

Task manager kill just whacks the program.

Nuke the site from orbit solution.

Anonymous 0 Comments

One asks the program to finish what it’s doing and close itself, the other asks the operating system to close the program immediately.

Anonymous 0 Comments

The guy who wrote task manager has a YouTube channel and made an episode about this. Search for Dave plummer.

Anonymous 0 Comments

One you ask politely for it to leave and wait for it to get its luggage, fill it and calmly leave.

The other you kick it out the door and burn its belongings.

Anonymous 0 Comments

I’ll just throw in a Linux reference (I don’t know if this also applies to windows).

There are 3 main ways to terminate a program in Linux: from the program itself, with a signal, hard kill.

Within the program: programs often look for you to ask it to close. That might be pressing a key or clicking a button. The program has to specifically look for that happening. Sometimes there’s a bug in the program and it forgets to check for your request. In that case clicking the button or hitting the key does nothing.

Signal: the OS can interrupt the program and tell it to do something, this is called a signal. Signals can be sent in multiple ways, but the command “kill” is the typical way from the command line (despite the name, kill can send lots of different signals, not just the one for kill). Even if the program is stuck doing something, the OS forces it to stop that and do something else. That something else is called a handler and the program decides what it is. On Linux, the signal that tells the program to shut down is called SIGTERM. If all goes well, the program stops what it’s doing (even if there’s a bug and it normally couldn’t stop) and tries to shut down cleanly (just like the “within the program” case). The big difference here is that the OS interrupted the program rather than the program checking for your request itself.

Hard kill: if both of the above fail, it means the program has a big problem and can’t be trusted to shut down. In this case, we’re not even going to ask. No buttons, no signals. The OS just stops the program in its tracks and removes it from memory. This is done using another signal called SIGKILL. This signal is special because the program never even sees it, the OS does everything.

We prefer the first two methods because the program might want to save open files and generally clean up after itself. The last one is a last resort since the program doesn’t have a chance to do anything before it dies.

Anonymous 0 Comments

The simplest version is that the operating system controls virtually all access between software and the hardware. The application itself can send instructions to the operating system to say “Hey, I’m good to shut myself down”, which the operating system will then accept and process…killing the task. If you use Task Manager, you are more closely interacting with the operating system itself (technically, using a different application with higher privileges) – and your instruction is to “stop executing that task”, which the OS is happy to oblige, usually, and usually quickly.

The reasons why Task Manager is quicker at the job:

* if the application has any house cleaning to do before it shuts down like freeing up used memory or saving inprogress files it will complete them before asking to be shut down
* if it’s busy doing …whatever it is that it is supposed to do…or if anything has gone wrong and it’s stuck in an infinite loop – there may not be enough instruction cycles left for it to actively monitor the X button for clicks, so it never, or very slowly queues the command to shut itself down.
* Task manager doesn’t care about those things – it just looks at the list of tasks that get allocated processor time, and removes the task/threads associated. That program ceases to exist.

When you say ‘work better’ – it works better at killing the program more quickly, but can do damage to files that may be in the process of being written, only getting part of the data computed or stored before the app stops.