Hello all,
I use open3 library from non-main threads, and I get the following warning
/usr/lib/ruby/1.8/open3.rb:39: warning: fork terminates thread at easinstaller.rb:41
My thread is terminated, and I wonder why ending some forked Ruby process could terminate my thread?
···
–
Best regards,
Yuri Leikind
Yuri Leikind wrote:
Hello all,
I use open3 library from non-main threads, and I get the following warning
/usr/lib/ruby/1.8/open3.rb:39: warning: fork terminates thread at easinstaller.rb:41
My thread is terminated, and I wonder why ending some forked Ruby process could terminate my thread?
I don’t know about open3, but if more than one thread is active when you
fork, you get this warning, and the child starts with only one thread
running. No threads should be terminated in the parent, though.
$ cat t.rb
Thread.new {sleep}
fork do
puts “In child: #{Thread.list.inspect}”
end
puts “In parent: #{Thread.list.inspect}”
$ ruby t.rb
In parent: [#<Thread:0x401c7074 sleep>, #<Thread:0x401d3900 run>]
t.rb:4: warning: fork terminates thread at t.rb:1
In child: [#<Thread:0x401d3900 run>]