[Top][All Lists]

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

Re: doco scm_remember_upto_1

From: Kevin Ryde
Subject: Re: doco scm_remember_upto_1
Date: Thu, 12 Jun 2003 09:07:54 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

Marius Vollmer <address@hidden> writes:
>     But this is not the case, a GC will only run when all threads are
>     in a safe place and have been stopped.

Right, yep.  I reworded it in a more direct sense as follows, dropping
the "it might be thought" business, which was only really me getting
wrong ideas.

   In a multi-threaded program, the rule is the same.  As far as a
   given thread is concerned, a garbage collect still only occurs
   within a memory allocation function, not at an arbitrary time.
   (Guile waits for all threads to reach a memory function, and holds
   them there while the collector runs.)

>     But when in doubt, be
>     conservative: include the call to scm_remember_upto_here_1 when
>     you are not sure that it is safe to leave it out.

I think I'd rather see something unambiguous said about when a
remember must be used, instead of talking about being unsure.  I tried
to reword a little to emphasise it's memory activity which provokes a

>     A call to
>     scm_remember_1 will cost at most as much as a call to an empty
>     function.

Or less, if the asm block approach is right, or if storing to a global
"volatile" variable would similarly be right.  :-)

> Is that important?  A note that says that the non-varargs functions
> might be more efficient should suffice, no?

I'm only thinking to encourage the best way.  I suppose the cost is
always going to be small compared to real work done, it's just a case
of not wanting to go along an inferior path.

In any event, I checked in the new section.

reply via email to

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