From: Charles Oliver Nutter Date: 2008-07-02T06:04:59+09:00 Subject: Re: [ANN] threadify-0.0.1 ara howard wrote: > > > this one's for you charlie ;-) Appears to work just dandy under JRuby: ➔ time jruby --server -rthreadify -e "nums = *(1..35); def fib(n); if n < 2; return n; else; return fib(n - 1) + fib(n - 2); end; end; nums.each {|i| p fib(i)}" ... real 0m11.889s user 0m11.733s sys 0m0.188s ~/NetBeansProjects/jruby ➔ time jruby --server -rthreadify -e "nums = *(1..35); def fib(n); if n < 2; return n; else; return fib(n - 1) + fib(n - 2); end; end; nums.threadify {|i| p fib(i)}" ... real 0m8.213s user 0m12.722s sys 0m0.178s (One thread on my system consumes roughly 65-70% CPU, which explains why full CPU on both cores doesn't double performance here) I also found some weird bug where Thread#kill/exit from within the thread interacts weirdly with join happening outside, and never terminates. Fixing that now. - Cahrlie