Hi,
In message "[ruby-talk:12981] Re: Native/pthreads in Ruby"
on 01/03/21, "Marc Butler" <marc.butler / voyanttech.com> writes:
|>From cursory inspection of the source code Ruby appears to use a
|conservative Mark-Sweep garbage collector. This would require all threads
|that my potentially 'mutate' the heap be suspended before the garbage
|collector runs, and remain suspened until it has finished. POSIX threads
|does *not* provides mechanism by which threads may be suspended without
|cooperation. [LinuxThreads, 2001]
Giant interpreter lock like Python's may solve this.
|Garbage collection and Threading are of interest to me and I would be happy
|to discuss in more detail with like minded list participants.
Inform me since I'm not a thread expert.
Currently, I'm thinking of the scheme following.
* add configure option to enable native-thread (which is off by
default).
* add interpreter lock for native-thread enabled interpreter.
* wrap pthread_create() to preserve stack address for each new
thread like Bohem GC.
But there might be better way.
matz.