Starting ruby code from within jvm

dear groupies,

this could be a very stupid question - i am hoping at least.

i have written a little application using jruby.

when i do

jruby -S myapp.rb

I am assuming that jvm is loaded, then jruby and then myapp.rb

I actually want to start myapp a number of times so it can do its
stuff in parallel. When I do that it seems that jvm, jruby and
myapp.rb all get loaded into memory again - which is what i would

Question: how would I go about just loading and executing myapp.rb
multiple times as separate processes which would not involve loading
jvm jruby each time?

Thanks for any insights?


To unsubscribe from this list, please visit:

Maybe something simple like this?

3.times do do
load ‘myapp.rb’

This would load up three separate native threads and run your program.

On Fri, Oct 30, 2009 at 12:41 PM, jason franklin-stokes <

Hi Jason,
inside java code You can use jsr233 (java scripting api) or the new
RedBridge implementation. That way You can have one master process in
java that will start threads that will execute your ruby script. One
other way would be to do it with ruby master process run inside jruby
and using eval method to run your script in threads.

Best greetins,
Pawel Wielgus.

2009/10/30, jason franklin-stokes [email protected]:


To unsubscribe from this list, please visit:

To unsubscribe from this list, please visit: