Actually, it's fairly straightforward to evaluate these thread issues:
If you want to use a programming language
with AOLserver, or with any other genuinely multi-threaded program,
and you want to use it in a general purpose,
fully functional way, then you definitely don't want to use Ruby. Nor
R or Python, for that matter. What you want is a fully thread-safe
and reentrant language implementation, period.
If on the other hand, your program is strictly single threaded,
or perhaps also if you are willing to use
said programming lanaguage from one thread only
and you are willing to ad-hoc figure out how
to do so safely for your particular non-thread-safe language, then the
doors are wide open - use Ruby, Python, or whatever else you're
willing to hack in, and make work.
And that "one thread in my multi-threaded program" approach
will involve trial and error on the
thread-safety bits, it is not a matter of just following some simple
recipe.
(Btw, the reason is somewhat deep: All current threading
libraries use mutex locks, and locks do not compose. Transactions do.
This is basically why transactions are awesome and locks suck. But I
digress...)
Practically speaking, I think the above means that you might want to
use something like R or Ruby from AOLserver for some one
special purpose, which you know ahead of time.
Typically, you have an existing special purpose code library, and you
want to call it from your web server - cool. You might want to embed
it, you might want to just fork off scripts as needed, I suppose it
depends on the exact use case.
But given the limitations above, I can't see it ever making practical
sense to embed a non-multithreaded language implementation into
AOLserver for general purpose use. (Tcl is
AOLserver's principal general purpose language.)
In the case of, say, AOLserver and Ruby, the dark horse way around all
the limitations above might be to change all of AOLserver underneath
to use multiple processes and shared memory rather than threads. At
the Tcl level, everything would look the same. At least some of the C
code underneath would definitely see differences, though.
Multi-process AOLserver should certainly be possible to do, somehow,
but I've no basis for even guessing how much hacking it would require,
nor what performance problems or other difficulties might crop up.
Oh, and it probably would never work right on MS Windows at all, only
Unixes.
I doubt you want to go there with AOLserver. Neat hack, and it might
be the easier route, but it'd probably be more fun to "just" write
your own single-threaded web server in Ruby, or implement your own
multi-threaded version of Ruby for AOLserver. :)
Now, Zoran Vasiljevic, creator of the AOLserver-inspired Tcl Threads
Extension, has mentioned several times how he would like to
add complete multi-process support to the Threads Extension, with an
API essentially identical to the current multi-threaded one. He's
just never done it because he couldn't come up with any practical need
for it in his work. I bet you won't either. :)
Btw, supposedly, way back in the mid 1990's when the Navisoft guys
were first writing AOLserver, Tcl was not thread safe. But,
do to its clean implementation, intended for easy embedding in larger
C programs, the Naviserver guys were able to make Tcl multi-threaded
quickly and easily. Presumably that's one of the single biggest
reasons why Tcl was ever used in AOLserer at all. (That's all
hearsay, but you can ask Jim Davidson if you want to know for sure.)
Clearly Python and Ruby were not so much intended for easy embedding
in other programs, and certainly not in multi-threaded programs. I
think the creators of each have publically said as much, too.