this post was submitted on 15 Jan 2026
642 points (88.5% liked)

Programmer Humor

31518 readers
2662 users here now

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

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Scoopta@programming.dev 223 points 4 months ago* (last edited 4 months ago) (14 children)

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.

[–] Feyd@programming.dev 64 points 4 months ago* (last edited 4 months ago) (5 children)

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.

[–] Scoopta@programming.dev 0 points 4 months ago (1 children)

You clearly didn't read my message...I said a "window close message." I.e...WM_CLOSE. that is not a process signal, it's a window management signal. Hence taskkill not working without /f on headless processes

[–] Feyd@programming.dev 2 points 4 months ago* (last edited 4 months ago) (1 children)

Long running headless processes on windows generally still have an event loop and a window handle via which they process those messages.

[–] Scoopta@programming.dev 2 points 4 months ago* (last edited 4 months ago) (1 children)

...right...tell that to cmd.exe or the OpenVPN daemon, or the soft ether VPN daemon, or OpenConsole.exe, or Idk, I only tested 4 that immediately came to mind but my point stands. There are a lot of programs that do not have a window handle and do not bother with window messages.

[–] Feyd@programming.dev 0 points 4 months ago (1 children)

Service (daemon) lifecycles are managed via the system services api.

[–] Scoopta@programming.dev 2 points 4 months ago

Yep, I'm aware of that too, doesn't change my initial point

load more comments (3 replies)
load more comments (11 replies)