Ironically it's actually the opposite. Linux has signals, and with the exception of SIGKILL and I think SIGABRT they can all be handled gracefully. Windows on the other hand doesn't have signals, it can only TerminateProcess() which is forceful. The illusion of graceful termination on windows is done by sending a Window close message to all of the windows belonging to a given process, however in the event the process has no windows, only forceful termination is available due to the lack of a real mechanism to gracefully terminate processes. That's why the taskkill command tells you a process requires forceful termination when you run it against something headless.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
Windows does, in fact, have signals. They're just not all the same as Unix signals, and the behavior is different. Here's a write-up.
You're correct there is no "please terminate but you don't have to" signal in Windows. Windowless processes sometimes make up their own nonstandard events to implement the functionality. As you mentioned, windowed processes have WM_CLOSE.
Memory access violations (akin to SIGSEGV), and other system exceptions can be handled through Structured Exception Handling.
You're right about Linux but you're wrong about windows. It is sent to the event loop in windows https://learn.microsoft.com/en-us/windows/win32/winmsg/window-notifications. It's been a long time since it was my job, but you actually had to pass a certification that your application exited gracefully in response to these messages as part of the partner program back in the day.
While the meme is very funny, it is technically incorrect. Linux has two major ways of terminating a process. When Linux wants a process to terminate execution (for whatever reason) it first sends the SIGTERM signal to the process, which basically "asks" the process to terminate itself. This has the advantage, that the process gets the chance to save its state in a way, that the execution can continue at another time. If the process however ignores the SIGTERM signal at some point Linux will instead forcefully terminate the execution using the SIGKILL signal. This represents what the image shows.
Before someone gets mat at me: I know, that there are like 50 more Signals relevant to this, but wanted to keep it simple.
While the meme is very funny, it is technically incorrect.
The worst kind of incorrect!
Simple answer for us simple folk. I like it. Thank you!
Does the "SIG" stands for "Signal"?
Special Interest Group. An internal committee convenes to decide the fate of the process.
(I don't know the answer, but I'm pretty sure it stands for signal.)
I like to secretly imagine it stands for SIG SAUER. Bang = process ded
Windows treats user commands like most tech treats consent. Negotiable, ignorable.
Linux brooks no bullshit. The program will do as it is told.
That isn't exclusively true. Programs can capture SIGTERM and ignore it, or do as they please, SIGKILL is non-negotiable though.
Windows does have an equivalent to SIGKILL as well, in taskkill /F.
Yeah. I regularly wake up to my work computer having nonconsensually rebooted overnight (closing all open applications, because who cares)
96% through recovering an attached 20tb RAID and windows update decides i should go fuck myself.
And that is why it's only on my work laptop. And only because i'm forced at gunpoint
Stop spreading this lie. Linux has a more graceful shutdown process than Windows ever did. It doesn't abruptly kill everything.
Graceful like closing a laptop and putting it in a backpack only to have windows refuse to shutdown and become a heater until it cooks the battery and ruins the screen....
worse. windows literally goes to sleep when i close the lid after i told it to shutdown.
so when i boot it up again, what happens? inevitably it wakes from sleep, only to remember that i told it to shut down, then it shuts down. then i have to boot again.
Oh sweet summer children.. its worse. Linux tells the program to kill itself, then makes sure it happens
Windows:
- program refuses to shutdown
- system: okay, guess you don't need your computer to turn off anyway
Such grace.
There is a windows registry hack to set the shutdown wait time for 1s and that did fix it for me. But every update they turn it back to unlimited.
(I ended up installing Linux, I only have the dnf5daemon server holding the shutdown up for atnost 5min now. But I haven't tried to fix it)
Which is why in my Windows days I got a habit of turning computer off with Windows + R --> shutdown -s -f -t 0
Windows just works, my ass :)
/c/programmer_ignorance
This meme gets crustier and crustier every time I see it. It’s amazing after all these years people still post this.
Windows task manager:
Let's play a whack a mole game where the app you're trying to kill constantly moves up and down a list by default! Enjoy!
There's a non-obvious freeze function in the Task Manager - for as long as you hold the Ctrl key, it'll stop updating the list. I have no idea why this functionality is hidden, but I guess Dave Plummer had some unusual ideas about UX.
I get it windows is evil and bloated, blah blah blah.
But to hear some of you describe the problems that you have using windows makes me think that you're as incompetent as my grandmother.
I do find it a little amusing the people complain about things that are (an admittedly advanced) config away from being the way they want. As if Linux doesn’t have settings buried in a similar way to registry changes.
Isn't that what SIGTERM is?
A request to gracefully shutdown processes.
kill, and I swear to god if you're still there when I ps, I'm getting out the -9
alias murder="kill -9"
Windows: If you can't exit gracefully, I'll make sure you never exit at all
I mean, also look at how windows installs programs. Its like a 100 step process taking several minutes, because just putting the files where they need to be is just too simple.
Or the uninstall program, cant just remove the files, no... Need to run full installer backwards to remove all the registry entries and even reboot the system to get rid of it all.
One of the actual (many) reasons that drove me from Windows. Over the years it became so dirty to have so many old files and registry entries that were abandoned by their respective uninstallers that I became wary of installing anything at all, and that's not the feeling I want with my personal computer.
Android/iOS users: What is “closing“? What is a „program“?
Android folks generally know because we have to close them sometimes. Don't know about iPhoners
From what I've heard about Windows, it works more like the Simpsons "Barney coming up behind Moe" meme.
So, as it should be, Tux.
Android ain't no better. If I don't pull up my app list and manually kill my media player, it doesnt stop and drains the battery despite tapping the exit menu item
kill -9 that motherfucker.