This is an updated patch to allow JRuby to launch external Ruby
scripts (called via Kernel.system or backquotes) within the same JVM,
taking advantage of our early multi-VM capability. For example, with
this patch a call to Kernel.system("ruby my_script.rb") will not end
up launching a new process; instead, it will create a new JRuby VM
(runtime) in the current VM, exec the script in question, and return
to the calling runtime.This patch is now, as it was before, intended to allow Rakefiles that launch external scripts to remain inside a single JVM. Since our process IO streaming capabilities are not exactly perfect, this provides a much more reliable (and much lighter-weight) way to launch external scripts. I would really like some input on this patch. It's a hack, but a pretty good hack. Perhaps it's something we would want to turn on and off...and I know there's some cleanup that could be done. I believe that a better solution would come from the Ruby principals in the form of a Kernel#exec_script method that can be made MVM-aware. Currently, there's no way to tell the Ruby interpreter to launch a new script in a platform-independent way, and therefore we need hacks like in this patch to allow JRuby to keep scripts from starting up new VMs. I posted an email about this to the ruby-core mailing list, but never got a response. -- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ jruby.sourceforge.net Application Architect @ www.ventera.com
exec_ruby_scripts_in_process.patch
Description: Binary data
