Hacker News
Is 'fork' missing operation in sandboxes?
JoeAltmaier
|next
[-]
I remember implementing the original fork() call in the first Posix implementation. It consumed so much CPU time and resources (on machines with precious little of either) that I optimized it. It was often (usually) followed by exec() which combined meant, start this parallel process. The downside was, fork copied the entire parent process state, just to instantly throw it away on the next call.
So I made fork() do a lightweight copy (no pages, no tables, just mark the new process as a child of the older one) and upon exec 'forget' to complete the fork. Else the child process would fault on the incomplete copy as it executed and complete it then.
thepoet
|next
|previous
[-]
Disclosure: I am working an open-source KVM-based VMM for agent sandboxes, https://github.com/instavm/tarit
damezumari
|root
|parent
|next
[-]
Also, storing large memory dumps is in my view not cost efficient as mostly restoring state is fast enough.
What do you consider to be main benefit in live fork?
Iv
|root
|parent
|next
|previous
[-]
ithkuil
|next
|previous
[-]
ytxm
|root
|parent
[-]
damezumari
|next
|previous
[-]
Disclaimer: I know there's some more effort 'snapshotting' and other concepts elsewhere too, but from our point of view making it first-class citizen in both UI and API felt sensible and it has been useful.
verdverm
|next
|previous
[-]
jstanley
|next
|previous
[-]
EDIT: I see you're only cloning filesystem contents, never mind.