(2010/03/24 16:23), Michael Graff wrote:
> If I'm walking through the code correctly, it appears this happens in
> several places within Ruby 1.9.  If this is the case, is this safe?

You know, POSIX doesn't specify it and NetBSD 4 doesn't support.
But users want to do it, so we are trying to support it.

> I'm running into problems running this method on NetBSD 5.0.2 (either on
> 32 or 64 bit, and after patching NetBSD's pthread library to properly
> set an internal state variable.)

Is it kern/42772?
If so thank you for working.
If not thank you for testing.

> 50.times do
>    assert_normal_exit %q{
>      at_exit { p :foo }
>
>      megacontent = "abc" * 12345678
>      #File.open("megasrc", "w") {|f| f<<  megacontent }
>
>      Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }
>
>      r1, w1 = IO.pipe
>      r2, w2 = IO.pipe
>      t1 = Thread.new { w1<<  megacontent; w1.close }
>      t2 = Thread.new { r2.read }
>      IO.copy_stream(r1, w2) rescue nil
>      r2.close; w2.close
>      r1.close; w1.close
>    }, '', ["INT"] or break
> end
>
> All other threading tests pass (with the mentioned libpthread patches,
> which I am about to commit to NetBSD) but this one seems to be doing too
> much after fork() for NetBSD to like.

Mac OS X also can't pass this test. (it will freeze)
So this may be Ruby's bug.

I'll check this test deeper later, but I can say now is that.

-- 
NARUSE, Yui  <naruse / airemix.jp>