rex goxman ڧѧ 04.07.2012 16:26:
> If jacques1 is right, then there are no green threads, just kernel
> threads, and I'm out of luck (anyone know why they would do away with
> green threads instead of keeping them and also adding kernel 
> threads?).
>
> I did a quick-and-dirty test here (ruby 1.9.3) to try to shed some
> light.  My assumption is that green threads should be incredibly 
> cheap
> to create (on the order of at least thousands per second), where as
> kernel threads should be much, much slower.
>
> (1..5000).each {Thread.new{}}
>
> This takes around 12 seconds to execute on my machine.  It seems far 
> too
> slow for green threads (I can create hundreds of thousands of green
> processes in erlang per second).  However, someone out there correct 
> me
> if I am wrong, but I would also expect kernel threads to be much 
> slower
> than the above, i.e. on the order of a few per second.  I coded up a 
> TCL
> version of the same above, which I know uses kernel threads.  It only
> spawned a couple heavyweights per second.
>
> I guess the results are indeterminate?  Hopefully someone else will
> chime in who knows definitively.

Ruby 1.9 uses kernel threads and does not have green threads.
There is nothing like Erlang's lightweight processes in Ruby (or, for
that matter, in most of the languages).

-- 
   WBR, Peter Zotov.