Embedding ruby in aolserver (Was: Re: segfault when calling rb_eval_string_protect ...)

Hmm I see. That could be a bit of a problem for my application given
that aolserver is highly threaded. I'd have to make a pool of
interpreters and supervise access to them to ensure only one thread is
using each interpreter at once...

I'm also starting to look at the work going into the byte compilers -
if I could have a pool of compilers, cache the bytecode and then only
fire up a vm for each request that might be ok.

Any timeline for thread safety?

···

On 5/22/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

README.EXT in the distribution and the Pickaxe book. Note that Ruby
interpreter is not thread safe at all (yet). Only one thread can
access Ruby interpreter at a time.

                                                        matz.

Hmm I see. That could be a bit of a problem for my application given
that aolserver is highly threaded. I'd have to make a pool of
interpreters and supervise access to them to ensure only one thread is
using each interpreter at once...

Making a pool of interpreters could have it's own problems. AFAIK, Ruby doesn't support multiple interpreters in the same process.

···

On May 22, 2006, at 3:57 AM, Mark Aufflick wrote:

I'm also starting to look at the work going into the byte compilers -
if I could have a pool of compilers, cache the bytecode and then only
fire up a vm for each request that might be ok.

Any timeline for thread safety?

On 5/22/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

README.EXT in the distribution and the Pickaxe book. Note that Ruby
interpreter is not thread safe at all (yet). Only one thread can
access Ruby interpreter at a time.

                                                        matz.

Yes, they would have to be in seperate processes, which then loses the
benefits of aolservers fantastic inter-thread communication.

Maybe I should just help out with one of the VM projects and make sure
that they are thread safe. The interpreter at least - the compiler
being thread safe is not as important.

···

On 5/23/06, Logan Capaldo <logancapaldo@gmail.com> wrote:

Making a pool of interpreters could have it's own problems. AFAIK,
Ruby doesn't support multiple interpreters in the same process.

I'm pretty sure JRuby is thread safe. Can aolserver talk to Java? It could be a sort of stop-gap solution.

···

On May 22, 2006, at 9:52 PM, Mark Aufflick wrote:

Yes, they would have to be in seperate processes, which then loses the
benefits of aolservers fantastic inter-thread communication.

Maybe I should just help out with one of the VM projects and make sure
that they are thread safe. The interpreter at least - the compiler
being thread safe is not as important.

On 5/23/06, Logan Capaldo <logancapaldo@gmail.com> wrote:

Making a pool of interpreters could have it's own problems. AFAIK,
Ruby doesn't support multiple interpreters in the same process.

Just because aolserver is multithreaded doesn't mean that you need to
access the ruby interpreter from each thread. Just make sure that only
one thread accesses the interpreter at a time or create a single
thread that access is funneled through.
   -tim

···

On 5/23/06, Mark Aufflick <mark-ruby@aufflick.com> wrote:

Yes, they would have to be in seperate processes, which then loses the
benefits of aolservers fantastic inter-thread communication.

Maybe I should just help out with one of the VM projects and make sure
that they are thread safe. The interpreter at least - the compiler
being thread safe is not as important.

On 5/23/06, Logan Capaldo <logancapaldo@gmail.com> wrote:
> Making a pool of interpreters could have it's own problems. AFAIK,
> Ruby doesn't support multiple interpreters in the same process.

Very interesting idea - is JRuby 100% compatible/compliant with regular ruby?

···

On 5/24/06, Logan Capaldo <logancapaldo@gmail.com> wrote:

On May 22, 2006, at 9:52 PM, Mark Aufflick wrote:

> Yes, they would have to be in seperate processes, which then loses the
> benefits of aolservers fantastic inter-thread communication.
>
> Maybe I should just help out with one of the VM projects and make sure
> that they are thread safe. The interpreter at least - the compiler
> being thread safe is not as important.
>
> On 5/23/06, Logan Capaldo <logancapaldo@gmail.com> wrote:
>> Making a pool of interpreters could have it's own problems. AFAIK,
>> Ruby doesn't support multiple interpreters in the same process.
>

I'm pretty sure JRuby is thread safe. Can aolserver talk to Java? It
could be a sort of stop-gap solution.

========================================================================
iBurst Wireless Broadband from $34.95/month www.platformnetworks.net
Forward undetected SPAM to: spam@mailsecurity.net.au

--
Mark Aufflick
e: mark@pumptheory.com
w: mark.aufflick.com
p: +61 438 700 647
f: +61 2 9436 4737

I think part of the reason he wanted to do this (after all there's already mod_ruby, mongrel and fastcgi) is precisely because of aolserver's thread-heavy architecture. Using only one interpreter kinda kills the point.

···

On May 24, 2006, at 3:24 AM, Tim Becker wrote:

Just because aolserver is multithreaded doesn't mean that you need to
access the ruby interpreter from each thread. Just make sure that only
one thread accesses the interpreter at a time or create a single
thread that access is funneled through.
  -tim

On 5/23/06, Mark Aufflick <mark-ruby@aufflick.com> wrote:

Yes, they would have to be in seperate processes, which then loses the
benefits of aolservers fantastic inter-thread communication.

Maybe I should just help out with one of the VM projects and make sure
that they are thread safe. The interpreter at least - the compiler
being thread safe is not as important.

On 5/23/06, Logan Capaldo <logancapaldo@gmail.com> wrote:
> Making a pool of interpreters could have it's own problems. AFAIK,
> Ruby doesn't support multiple interpreters in the same process.