Re:Phantom OS
by Asmod4n on Friday March 25, 2022 @08:29PM
(#30808250)
macOS does something kinda like it. For when your battery dies you just have to boot the machine and all running apps will sort of start in their previous state.
[ Parent
| on HN ]
That really depends on how well the app manages its own state and specifically handles restarts. No mainstream OS can restart without running apps even knowing it.
A planned restart is just hibernation to disk, which is implemented in many OS's.
If you got a Mac without a battery you can try to write something in pages and just yoink the power cable. Upon the next boot pages should open with your document and not lost anything.
It’s possible with virtualization and containers. In those cases, to be fair, there applications are running in an environment that may not be aware it was restarted.
What if we're a simulation unknowingly getting a restart every time Johhny the alien closes and opens his laptop?
Isn’t this exactly what hibernation is?
Re:Phantom OS
by checker659 on Friday March 25, 2022 @09:51PM
(#30808624)
How is that any different from hibernation?
Memory isn’t snapshotted and dumped, then restored by the OS in a way that user space is largely unaware.
macOS/iOS has adopted a model of giving apps an opportunity to persist their own state before being terminated (which may be eagerly to reduce memory pressure or power consumption, for example) and then have the application restore its own state in whatever way is appropriate.
Outside of containers, hibernation almost needs to be a system-wide operation, which makes it inappropriate for OS updates, restoring from crashes (which, I suppose is what Phantom OS is trying to resolve), or hardware changes.
Note that "containers" is basically kernel-implemented namespaces, which is why a containerized app can be checkpointed and restored independently: they can preserve the semantics of kernel resources across runs. You could have just about any arbitrary app running in a "container" with it being none-the-wiser about it: it doesn't necessarily impact userspace support.