using open3.rb from a thread

Y

Yuri Leikind

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?
 
J

Joel VanderWerf

Yuri said:
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>]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top