[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
threads & gc
From: |
Michael Livshin |
Subject: |
threads & gc |
Date: |
16 Sep 2000 12:45:04 +0300 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (20 Minutes to Nikko) |
hello all.
the more I think about the recent "gc issues" thread here, the more
confused I become. the following might be not very coherent, sorry.
it was mentioned earlier (by Mikael, I think) that the plan is to
make sure, before doing GC, that all mutator threads are stopped.
now, I can think of two ways to stop all threads:
* assuming we know about all running threads, we just suspend them
"from the outside".
this would require:
* either a way to enumerate all threads in the process or a
requirement that all Guile-using threads are started with a
Guile-specific "pthread_create" wrapper.
* a way to suspend a thread from another thread. I can't find such
a thing in pthreads, maybe I'm looking in a wrong place?
* the "cooperative" way: there are "checkpoints" before each cons and
periodically in the evaluator.
this means that when GC occurs, no thread can be in the "just got a
new cell and it's half-initialized and now I'm suspended" state, so
life is good.
please set me straight,
--mike
--
Who's afraid of the garbage collector?
- threads & gc,
Michael Livshin <=