From: Robert Klemme Date: 2005-11-08T22:32:12+09:00 Subject: Re: Investigating Ruby - key limitations ? Daniel Spiewak wrote: > Ruby does have support for native threads in the form of Proc.new > However, it is recomended that you don't use them except for in > situations where you're doing long running tasks in native code. This > is because Ruby's lightweight threads spawn *much* faster than the > native Proc threads. Either this is a misunderstanding or I missed something fundamental. From what I know 1. Proc.new has nothing to do with native threads. 2. Modern OS's can spawn new threads at a high rate so IMHO the difference between native thread creation and ruby thread creation to pay off for the disadvantage of not using multiple CPUs. Here are some stats with a current 1.4 Java VM: max t11 - start time in thread: 32 avg t11 - start time in thread: 0.8901 max t2 - creation time : 32 avg t2 - creation time : 0.0187 max t3 - start time in main : 32 avg t3 - start time in main : 0.2452 t11 is the time it takes to reach the first line of code inside the new thread. t2 is the time it takes to create the thread instance (in the calling thread) t3 is the time it takes to create and start the thread (in the calling thread) Times are in milliseconds! Kind regards robert