I wonder how much of this you’d build in a new system. I don’t remember if they were merged, but there was a patch set floating around to save the state of a process to disk. XNU has a mechanism called ‘sudden termination’ that lets processes advertise that they are ready to be killed abruptly (equivalent of kill -9) because they’ve saved all state. On macOS, the window server keeps a copy of their frame buffers and window positions, so the GUI can appear with the windows back immediately and restart the process in the background. Combining this with process-state saving for the processes not in sudden termination state (and maybe with a ‘system going down, put yourself in sudden termination state if you can’ signal) might let you skip all of the suspend logic and just power off. Modern *NIX systems can boot in VMs in a handful of milliseconds, so a system built around this model should be able to come back in less time than it takes the screen’s backlight to come on.
there was a patch set floating around to save the state of a process to disk
you might be thinking of CRIU?
i think the approach you described is way too involved and requires support from each of the application. whereas what linux does is fully transparent to processes. and although booting and loading programs & saved states from disk can be quite fast nowadays, it definitely cannot compete with resuming from RAM.
I wonder how much of this you’d build in a new system. I don’t remember if they were merged, but there was a patch set floating around to save the state of a process to disk. XNU has a mechanism called ‘sudden termination’ that lets processes advertise that they are ready to be killed abruptly (equivalent of kill -9) because they’ve saved all state. On macOS, the window server keeps a copy of their frame buffers and window positions, so the GUI can appear with the windows back immediately and restart the process in the background. Combining this with process-state saving for the processes not in sudden termination state (and maybe with a ‘system going down, put yourself in sudden termination state if you can’ signal) might let you skip all of the suspend logic and just power off. Modern *NIX systems can boot in VMs in a handful of milliseconds, so a system built around this model should be able to come back in less time than it takes the screen’s backlight to come on.
you might be thinking of CRIU?
i think the approach you described is way too involved and requires support from each of the application. whereas what linux does is fully transparent to processes. and although booting and loading programs & saved states from disk can be quite fast nowadays, it definitely cannot compete with resuming from RAM.