"tmm1 (Aman Gupta)" <ruby / tmm1.net> wrote:
> Simple implementation of an after_fork{} hook: https://github.com/tmm1/ruby/commit/711a68b6599d176c5bcb4ef0c90aa195a290d1c0
> 
> Any objection?

I think there needs to be separate hooks for prepare/parent/child
(like pthread_atfork(3)).  The parent may need to release resources
before forking (prepare hook), and perhaps reacquire/reinitialize
them after forking (parent hook).

The prepare hook is important for things like DB connections;
the parent hook might be less useful (especially for apps which
fork repeatedly).