From: KOSAKI Motohiro Date: 2013-04-07T23:26:00+09:00 Subject: [ruby-core:54085] Re: Thread/fork issue > On second thought, I feel exit! is more essential solution. > > Because there may be other objects which behaves as "flush at finalization", > flushing IO objects is not enough. > > The problem is finalization is occur twice (at parent and child). > If ruby uses exit! for forked process, we can avoid dual finalization. > > However it means users of fork must finalize objects explicitly in > forked process. > For example, fork { print "a" } may lost "a" because buffered "a" is > not flushed. Also, Process.exit! escape to run at_exit handler. I think exit! is too drastic. it help many situation than flushing, but also makes much side effect. I suspect "fork { print "a" }" type output lost makes lots test-all break. Instead of, providing fork callback likes pthread_atfork() and uses it?