Split process cleanup into GC-specific finalisers and a global session-quit finaliser. The session finaliser collects all living processes and optionally their trees, and uses the new ps::ps_kill_parallel() to kill them in parallel with a grace delay controlled by cleanup_grace.
On creation, the cleanup info for the session finaliser is recorded in a doubly linked list that keeps track of living processes. It's doubly linked so that on GC of a process the node can be efficiently removed.
Branched from #367.
Split process cleanup into GC-specific finalisers and a global session-quit finaliser. The session finaliser collects all living processes and optionally their trees, and uses the new
ps::ps_kill_parallel()
to kill them in parallel with a grace delay controlled bycleanup_grace
.On creation, the cleanup info for the session finaliser is recorded in a doubly linked list that keeps track of living processes. It's doubly linked so that on GC of a process the node can be efficiently removed.