The os could close the program fast by simply not giving it more cpu time and releasing all the resources associated (memory, files, windows, sockets, whatever). It doesn’t do that because programs like to do their own cleanup as well, so when you press the X it just signals to the program to please close yourself. If for example it has a ton of data it wants to write down to disk or just too many open files, or reports back to some network address about something, it’ll take some time.
Latest Answers