From: Justin Collins Date: 2009-07-02T06:15:31+09:00 Subject: Re: ruby threads Vlad Smith wrote: > Hi guys! Hope you`ll find some time to assist with any ideas > > i have an array of links and a number of steps that needs to be done to > each of those links. > > there are always the same amount of links in array..so basically i can > do everything manually > > i was wondering how can i create the new thread for processing each of > those links , maybe there`s a way of doing something like this : > > array.each do |link| > a = Thread.new {....} > a.join > end > That almost works, except it will block on each thread before starting the next. threads = [] array.each do |link| threads << Thread.new {....} end threads.each do |t| t.join end -Justin