2013/4/7 KOSAKI Motohiro <kosaki.motohiro / gmail.com>:

> 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.

We can flush stdout (and stderr).
Because they are flushed just before fork, flush on child and parent
is harmless.
This doesn't solve problems about other objects, though.

Of course, there is a less-drastic document-only solution:
"Use exit! in forked child process to avoid dual finalization."

> Instead of, providing fork callback likes pthread_atfork() and uses it?

I'm not sure how such calllback is used.
-- 
Tanaka Akira