[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Let's throw out SCM_NEWCELL

From: Dirk Herrmann
Subject: Re: Let's throw out SCM_NEWCELL
Date: Mon, 10 Sep 2001 23:30:57 +0200 (MEST)

On Fri, 7 Sep 2001, Chris Cramer wrote:

> On Fri, Sep 07, 2001 at 02:50:37AM +0200, Dirk Herrmann wrote:
> > The reason that I have had problems with the idea that all but one thread
> > should go asleep during gc is, that I had no idea how this could be
> > realized:  What about threads that are waiting for a mutex?  What about
> > threads that are waiting for input?
> It's very enlightening to look at the way the Boehm GC handles this.
> What they do is have the garbage collector send a signal to every
> thread. The signal handler stores the current stack pointer and then
> calls sem_post() (to notify the collector that the thread has stopped) and
> sigsuspend(). The garbage collector calls sem_wait() for every thread,
> and everything is stopped.
> To answer your questions, threads that are waiting for a mutex or input
> would be in a sigsuspend() (for a mutex) or a read()/select()/etc. (for
> input) call, so they would receive the signal, go to sleep, then wake up,
> and go back to what they were doing.

Hmmm....  Wouldn't that mean that these threads still could be interrupted
at any moment?  Or, in other words, would that mean that we would have to
disable signals around initializations of objects (at least were such
initializations could interfere with gc)?

Best regards,
Dirk Herrmann

reply via email to

[Prev in Thread] Current Thread [Next in Thread]