On Wed, 11 Jul 2001, Rogers Gene A Civ 96 CG/SCTOB wrote:
> I was just wondering.  I remember hearing of Ruby being moved to POSIX
> Threads. Does anyone have any information on this?

Although Ruby could be ported to Posix threads, the advantage of the
current scheme is that you don't have to lock any data structures (and you
don't have to reserve memory for those locks).

And since this is a programming language and the user can do anything he
wants and Threads share a single ObjectSpace, you would have to lock
a whole lot of things (e.g. Java).

What I may like is the possibility to put one Ruby interpreter per POSIX
Thread, and make them communicate together through locked shared memory
and Marshal. But that's almost like networking several Ruby processes
together by SYSV Shared Memory.



Btw I have a question about Ruby's current Thread system. How do I adjust
the thread switching granularity? it was so coarse that I decided to use
fork() instead of Thread for generating timers (Linux goes down to the
1..10 msec range). This is why the profiler I posted the other day calls
fork() with a while/kill/sleep/end loop.



matju