From: Voroztsov Artem Date: 2007-11-24T23:43:39+09:00 Subject: will there be ability to use both native and green threads in Ruby 1.9/2.0 Does anybody know will there be support for both native and green threads in Ruby 1.9/2.0? I found letter with unanswered question in ruby-core: 2007/11/14, Berger, Daniel : > > -----Original Message----- > > From: David Flanagan [mailto:david@davidflanagan.com] > > Sent: Wednesday, November 14, 2007 11:31 AM > > To: ruby-core@ruby-lang.org > > Subject: Re: state of threads in 1.9 > > > > Jordi wrote: > > > Are Threads mapped to threads on the underlying operating system in > > > 1.9 or still using green threads? > > > If still using green threads, it is so because of a > > designing decision > > > or it is a limitation of the current implementation? > > > > > > > As others have responded, Ruby 1.9 uses native threads. But > > you still don't get true concurrency. The fear is that there > > are extensions that are not thread-safe yet. So even though > > native threads are used, only one is allowed to run at a > > time. This means that you won't see increased performance > > running a multi-threaded Ruby program on a multi-core CPU, > > for example. > > Can't we have both native *and* green threads? There are advantages and > disadvantages to both, yes? I know at least one user who says he won't > be able to use Ruby 1.9/2.0 because he's using it on very old hardware > (486's) for Point of Sale software. The native threads will be too > heavy. > > Really, the only time that I've needed native thread support is for > extending existing C libraries. I don't see the upside for general > concurrency, since we're not getting multi-core support anyway. > > Have I missed something? > > Regards, > > Dan