From: Rasputin Date: 2004-01-22T02:00:50+09:00 Subject: no timeslicing? I decided its high time I tried to learn threads again, and my best chance is to do it in Ruby. But the scheduler doesnt seem to want to run any threads until the previous ones have finished: ------------------8<------------------------ 0rasputin@lb:rasputin$ cat freds.rb symbols = %w( = ^ V < > @ # ! ) threads = [] string = "" symbols.each { |symbol| threads << Thread.new(symbol) do |sym| 9.times { string << sym } end } threads.each { |w| threads.join } puts string 0rasputin@lb:rasputin$ ruby freds.rb =========^^^^^^^^^VVVVVVVVV<<<<<<<<<>>>>>>>>>@@@@@@@@@#########!!!!!!!!! 0rasputin@lb:rasputin$ ------------------8<------------------------ The pickaxe example at: http://www.rubycentral.com/book/tut_threads.html#UA , which is almost identical, seems to timeslice ok. And if I scatter some magic Thread.pass dust in there it behaves itself. Is it just that the threads exit too soon to get suspended? This is on NetBSD 1.6Z with Ruby 1.6.8 and todays CVS. -- $100 invested at 7% interest for 100 years will become $100,000, at which time it will be worth absolutely nothing. -- Lazarus Long, "Time Enough for Love" Rasputin :: Jack of All Trades - Master of Nuns