From: "ara.t.howard" Date: 2007-10-14T01:27:27+09:00 Subject: Re: Is there a standard pattern for threaded access to a file? On Oct 13, 2007, at 9:50 AM, Simon Kröger wrote: > ara.t.howard wrote: >> [...] >> threads = [] and 5.times{ threads << Thread.new{ puts q.pop } } >> [...] > > just a question of style: > > while the above is quite clever, is there any (hidden) reason to > use it over > such primitive constructs like not really. mostly i just like the '5' to be more prominent in the code > > threads = Array.new(5){ Thread.new{ puts q.pop } } > this works > or > > threads = (1..5).map{ Thread.new{ puts q.pop } } seems kinda heavyweight, but yeah cheers. a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama