On Tue, Oct 16, 2001 at 03:39:58PM +0900, Mathieu Bouchard wrote:
> On Tue, 16 Oct 2001, Emiliano wrote:
> > Yukihiro Matsumoto wrote:
> > > |- I've been told (totally unverified) that ruby isn't thread-safe, and
> > > |  that making it thread-safe would be hard. How much truth is there to
> > > |  this?
> > > It's not thread-safe.  Some tried the way that everything related in
> > > Ruby in one native thread, then other threads send request via queue.
> > OK, so that'd be kind of a 'ruby server' thread. How about separate
> > scripts running in separate threads?
> 
> Ruby has its own little internal thread system that works by making the
> evaluator cooperatively threading with itself; C-level libraries that do
> I/O or long-lasting operations are encouraged to participate. At the Ruby
> level you have Threads and Continuations provided by that underlying
> system.
> 
> Which means you can do a 1-to-1 mapping from native threads to Ruby
> threads if you want. It also does not need to be a 1-to-1 mapping (it was
> just an example).
So, I could run a standalone process with embedded Ruby and have native 
threads to communicate with it for running scripts and it will be able to put 
executed scripts into different Ruby threads making whole execution
process 'thread-safe' from point of view of multi-threaded external
application (for example, Apache2)?

How much support from Ruby side for such kind of glue already in place?

-- 
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
  `Senior software developer and analyst for SaM-Solutions Ltd.`
---
Bing's Rule:
	Don't try to stem the tide -- move the beach.