Akira Tanaka <akr / fsij.org> wrote:
> Eric Wong wrote:
> > I support this proposal for Ruby 2.0.  Very few applications depend on
> > FD passing via exec() and they can easily be updated to set
> > close_on_exec=false.
> > 
> > I've just updated git://bogomips.org/unicorn.git myself.
<snip>
> I don't recommend io.close_on_exec = false for multithreaded programs.
> There is a race condition which cause fd leakage if another thread invokes
> system().
> (I guess unicorn has no problem because it is not multithreaded.)

Yeah, and even in Rainbows!, threads only get used in the worker
processes, not the master process[1] that calls exec()

> So I may change the default of :close_others to true even for system() and
> exec().

If so, I would like a way specify a set/array/hash of FDs/IOs we don't
want :close_others to automatically close on us.


[1] - Zbatery is a different story, but that's just one extra caveat to
      running with (optional) threads :<

-- 
Eric Wong