2006/5/27, Hal Fulton <hal9000 / hypermetrics.com>:
> ReggW wrote:
> > What is the reason why Ruby doesn't use native threads...at least on
> > Windows?
> >
>
> Green threads are the most portable, as threads differ
> from one OS to another, I would think. At least, I'm
> sure the Windows model isn't the same as pthreads.

Yuck.  And I believe Solaris is even another beast.

> Ruby just doesn't use native threads anywhere. If it did,
> it would support them first on Linux, its primary
> platform. (No flames, please -- I'm just saying that
> Matz develops on Linux, and the Windows port is derived
> from that.)

Fl...  Just kidding. :-)

> It's probably possible to write some kind of extension
> to support native threads, but I would think it's quite
> a bit of work.

I don't believe this can be done by an extension alone. Threading is
intertwined with IO operations, uses longjmp etc. IMHO this would
amount to a rewrite of a significant portion of the interpreter. And
that's probably also the reason why it does not happen for Ruby 1.x.

Kind regards

robert


-- 
Have a look: http://www.flickr.com/photos/fussel-foto/