From: Brian Candler Date: 2010-08-12T17:49:23+09:00 Subject: Re: Multithreading problem Jes炭s Gabriel y Gal叩n wrote: > But you still need the outer iteration. If I'm already iterating with > #each, I change it to map to do both things at the same time :-) Of course. But for a newcomer to ruby (who is still using 'for' instead of 'each'), it may be easier to take one step at a time along the road to enlightenment. Step 1: threads = [] for page in str threads << Thread.new do ... end end Step 2: threads = [] str.each do |page| threads << Thread.new do ... end end Step 3: threads = str.map do |page| Thread.new do ... end end -- Posted via http://www.ruby-forum.com/.