How can the Task Manager in Windows or Force Quit in macOS close frozen, suspended, unresponding programs instantly. What do they do different than clicking the X button in the corner?

1.35K views

How can the Task Manager in Windows or Force Quit in macOS close frozen, suspended, unresponding programs instantly. What do they do different than clicking the X button in the corner?

In: Technology

18 Answers

Anonymous 0 Comments

I want to try this one correct me if I’m wrong

When you click on the x to close a program generally the program have to clean the memory he used and he need to stop correctly any action he started. That’s why when it freeze a lot of time something is blocking the program to do any future action.

The task manager is sending a signal telling to kill the program and your computer does so without asking or checking the state of the program.

Anonymous 0 Comments

Closing a program with the ‘x’ button is typically OK but nit typically the preferred method.
Most programs will have an internal ‘quit’ process.
The ‘x’ is actually part of the window api that the program resides in.

If the program is truly in an unresponsive state, the window close feature will not always close the program.

Using taskmanager or similar gui app you can get a more manageable list of running processes.

Killing the program is not exactly the same as stopping it.

Stopped programs are still in ram and can be restored to run state. Occasionally this will rescue the process allowing the program to finish its task.

Killing a program will quite literally yoink it from ram and free up all the resources associated with it.
However this introduces opportunity for data corruption on open files. Among other factors depending on what the program is supposed to do.

Taskmanager is simply a graphical version of the commands tasklist and taskkill.
Tasklist displays all running processes,
while taskkill kills the process you supplied the pid or process identification number for.
Taskmanager literally uses both of the commands behind the scenes.

How x differs is if the program uses a hook to read the window x button state and if it overrides the window api to initiate its own internal shutdown process.
Such as close open files, finalize running tasks, store a resume state in a tmp file, return a physical device to its wait state.
The last item is typically a printer but could be anything.
Like machinery, recall a drone, or put a lid back on the reactor.
Where as if you kill the process you could cause unpredictable problems that might not be desired.
Ref Chernobyl.

Killing a process maybe the only solution at times and the decision should be made with the consequences in mind.

That said if you’re ever using your computer and get a message pop up that is strange, ie
Windows has determined that you have a security issue and to please call ### to solve.

That is probably a good time to just kill the process or yoink power to the pc.

Because clicking on the x will more than likely be hooked to an internal shutdown sequence in the process that generates a code and encrypts your hard drive.
Aka ransom ware.
Please refer to preferred method of shutdown.

Anonymous 0 Comments

When an application is running in the background it’s typing up system resources, clicking the x in the corner sends a signal to the application to quit when it’s able to. Using task manager or close frozen, or a shell, will send a different kind of signal that forces the app to kill whatever it’s doing and the CPU stops allocating those resources.

Anonymous 0 Comments

The X button says to the programme “user wants to close the programme, do what you gotta do to finish up and close, please”. That might include completing any processes that are running, saving data, dumping cache, etc. Anything the programmer put in there. Task manager bypasses all of that and just stops the programme running instantly.

Notice how some programmes know that they weren’t shut down properly? That’s because they include a flag in the normal X button shutdown routine. If the shutdown routing wasn’t run, the flag never gets set.

Anonymous 0 Comments

X: Ask your friend to close the door.

ForceQuit: Close the door yourself.

To clarify further, the X tells the program that it should close itself. If the program isn’t responding, it might not be able to run the internal commands it has set to perform to close. ForceQuit forcefully terminates the process using OS specific mechanisms and cleans up the resources.

Anonymous 0 Comments

There are different levels of “quit program”. Nicest are “user has indicated they would like to see you leave” type, allowing the program the time to just make their exit at their own time, and they go from “pack your stuff” to just plain removing the process from the list of programs that get scheduled CPU time, and freeing all the RAM and other resources they had reserved, basically dissolving the program right then and there.

The only one that really is absolutely enforced is kill signal, the one that completely evaporates the program. Others are ones where there exists a tradition of what program should do upon receiving them, which usually involves closing the program, but the program is allowed to handle those by itself. There are default behaviors that tend to be in place unless programmer specifically wanted to override them, so you often get fairly uniform behavior. Especially the standard “press the X” functionality is very often something programmers make sure works as intended and as user expects, so you can expect that to work most reliably out of voluntary kill signals.

This answer is based on Linux tho. Macos should be similar as it’s a related operating system with these types of core features probably being identical, and even Windows seems to use a similar system under the hood, but I’m not sure if there are some less obvious differences that I should mention. On the surface it seems to work the same tho.

Anonymous 0 Comments

There’s a guy in a bar that’s closing. The bartender tells him it’s time to leave. He refused to leave.

So the bartender calls out Joey. Joey shoots the patron in the head, and dumps the body outside.

The bartender is the “X” and Joey is “force quit.”

Anonymous 0 Comments

Think of yourself as king of the computer, hitting the x is like ordering someone out of your throne room, force quit/ end task is like pulling the lever for the trap door they are standing on.