On 4/26/06, Evan Buswell <[EMAIL PROTECTED]> wrote:
> Since YARV (and therefore Ruby 2.0) seems to be planning switching from
> Green Threads to Native Threads (or at least that's what I get from
> looking through the cryptic notes at
> http://glu.ttono.us/articles/2005/10/14/yarv-progress-report) do we even
> *want* to implement green threads?  If we are compiling to Java and
> wanting full Java->Ruby instead of just Ruby->Java, we probably *want*
> Ruby threads to be native threads, no?  Unless of course its simply not
> possible to get the same behaviour.

The current plan is not to go with green threads per se, but to go
with m:n threading. That will allow us to scale all the way from green
threads (which a lot of legacy code will benefit from) to pure native
threads (which is still very important to keep) and still support
continuations and other thread-manipulating features that Java does
not natively support.

Continuations are the biggest driving factor in that decision (with
Ruby's quirky threading model close behind). Without any way to
capture and call continuations in the JVM (for the foreseeable future)
we need a way to run Ruby code without deepening the stack. By mixing
green with native threads and executing code iteratively, we can pull
off a continuation at any time, and scale up and down through the
different threading models. We also have a plan to do bytecode
compilation while still supporting continuations, but most of that is
still on the drawing board.

While many people say supporting continuations is not
important--presumably because very few applications or frameworks make
use of them--it is my belief that simple, digestable continuations in
a mainstream, straightforward language will only increase their
acceptance. It is therefore imperative that we have support for
continuations in JRuby, and thus the mixed threading model.


--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to