From: ara howard Date: 2008-01-11T07:51:33+09:00 Subject: Re: Before I create a ticket On Jan 10, 2008, at 2:54 PM, Dave Thomas wrote: > Is it reasonable to expect the following to produce differing counts > in the result array? > > counts = [ 0 ] * 10 > Thread.abort_on_exception = true > 10.times do |i| > thread = Thread.new(i) do |index| > Thread.current.priority = index > loop do > counts[index] += 1 > Thread.pass > end > end > end > sleep 1 > p counts > > > I get [6176, 6173, 6167, 6173, 6174, 6175, 6177, 6178, 6174, 6177] > > ruby 1.9.0 (2008-01-10 revision 0) [i686-darwin9.1.0] maybe throw a 'reverse' in there somewhere - right now it seems like each thread would be afforded about the same amount of time before being superceded - excepting the last one. it'd be interesting with Thread.current.priority = 10 - index cheers a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama