If I have an array to be filled with computationally heavy stuff, 
I could use a load of Threads to populate it in parallel.  If I often
have to re-populate it, I don't want to kill them all off and start
them again.

    my_array = Array.new(MANY)
    threads = []
    my_array.each_index { |i|
        threads << Thread.new(i) { |ti|
            loop {
		#...
		my_array[ti] = result
		Thread.stop
            }
        }
    }

I can then use

    Thread.pass while threads.detect {|t| t.status == "run"}

for may Thread.main to wait till they have finished populating the 
array.
I can kick them off again with threads.each {|t| t.run} of course.

My questions are:

Is this sensible?

Are there rules of thumb to determine how expensive the computation 
must be to make this worthwhile?

What happens if Thread.main is the only thread left, and it calls 
Thread.pass? 

	Hugh
	hgs / dmu.ac.uk