> modern OSes want to be able to close programs behind your back, while they seem to still be running, and then restore them to their previous state when you come back to them.
I thought they were suspending them, not closing them. Those are very, very different things.
In any case, pretending that applications aren't closed when they are is no better.
What is “suspending”? Like what https://github.com/maaziz/cryopid does? No OS uses such a technique for production process management. (Well, I guess you could say that Genode does if you consider VMs to be processes.) Processes are too non-self-sufficient for this to work with full generality. (For example, what would a process do if it “freezes” in the middle of executing within a shared library’s code section, and then an OS update is applied, replacing that library on disk? The “defrost” process would presumably re-run the dynamic loader, putting the new version of the library into memory; but now the defrosted thread’s PC points into the middle of an instruction. Oops!) CrypPID-like techniques only work in controlled environments, like if you’ve got a machine serving solely as a Docker container host and you want to “pause” containers.
On the other hand, if by “suspending” you mean “the OS asks the program to persist its running state to disk, which it can easily do because it’s using GUI-control and scene-graph frameworks that know how to serialize out their current state”—and then, when it has done this, the OS considers the process “clean” (like a clean page of disk cache) and therefore discardable—then yes, the OS is suspending processes.
Keep in mind that you need to add a flag to your application’s OS-readable metadata (the application manifest in Windows; the Info.plist in macOS/iOS) opting into this behaviour, signalling that your process is okay with being shut down at any time when it’s in the OS-visible “clean” state, and isn’t, say, a host for an RPC server that other applications are expecting to have a stable connection to.
I thought they were suspending them, not closing them. Those are very, very different things.
In any case, pretending that applications aren't closed when they are is no better.