From: Tanaka Akira Date: 2013-04-07T10:09:14+09:00 Subject: [ruby-core:54072] Re: Thread/fork issue 2013/4/3 Tanaka Akira : > 2013/4/3 KOSAKI Motohiro : >> >> I believe fork() should flush all IO objects automatically. 1) Why user >> should know how ruby beffering? 2) fork() is not common method and >> performance disadvantage is not much though. > > I see. Agreed. 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. -- Tanaka Akira