[ruby-core:64973] Re: [ruby-trunk - Bug #10231] [Open] Process.detach(pid) defines new singleton classes every call

From: Eric Wong <normalperson@...>
Date: 2014-09-11 20:59:11 UTC
List: ruby-core #64973
headius@headius.com wrote:
> I would suggest that Process.detach should return a subclass of Thread
> that has the pid method defined ahead of time.

Fair enough.

> It also stores the value in thread local storage, rather than as an
> instance variable. I'm not sure why.

It seems to be documented for Open3, so it might be spec and we can't
change it.

Fwiw, I do not like Process.detach and prefer to use trap(:CHLD)+waitpid
instead in applications.  Unfortunately trap is not library-friendly.

In This Thread