# Embedding ruby in aolserver (Was: Re: segfault when calling

**URL:** <https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106>\
**Category:** Ruby\
**Created:** [May 22, 2006, 9:59am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106 "2006-05-22T09:59:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Aufflick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Post date:** [May 22, 2006, 9:59am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106/1 "2006-05-22T09:59:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mark\_Aufflick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Post date:** [May 23, 2006, 2:09am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106/2 "2006-05-23T02:09:56Z")

</div>

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

> 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.

---

<div class="post-metadata">

**Author:** ![Mark\_Aufflick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Post date:** [May 23, 2006, 3:53am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106/3 "2006-05-23T03:53:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mark\_Aufflick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Post date:** [May 24, 2006, 12:20am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106/4 "2006-05-24T00:20:00Z")

</div>

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

> 

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

---

<div class="post-metadata">

**Author:** ![Mark\_Aufflick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Post date:** [May 24, 2006, 4:28am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-aolserver-was-re-segfault-when-calling/95106/5 "2006-05-24T04:28:06Z")

</div>

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