From: Eric Wong Date: 2013-11-30T23:05:37+00:00 Subject: [ruby-core:58722] Re: [ruby-trunk - Feature #5446] at_fork callback API "tmm1 (Aman Gupta)" 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).