複数のスレッドをすべて同時に起動したい。
10.times do
Thread.new do
sleep rand(5) # Initialize all the stuff
wait_for_all_other_threads # Wait for other threads to initialize their stuff
fire! # Go.
end
end
wait_for_all_other_threads
それらをすべてfire!
同時に実装するにはどうすればよいですか?