guile-user
[Top][All Lists]
Advanced

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

Re: Guile, pthreads and garbage collection


From: Neil Jerram
Subject: Re: Guile, pthreads and garbage collection
Date: 14 May 2002 00:42:28 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Michael" == Michael J Barillier <address@hidden> writes:

    Michael> I'm designing an app with a background thread that access
    Michael> Guile SMOBs.  If I'm running code in a pthread, can I
    Michael> trust Guile not to garbage collect a value while I'm
    Michael> accessing the content of the data structure under the
    Michael> SMOB? [...]

    Michael> Or, am I worrying needlessly about something that will
    Michael> never happen?

For now, maybe: Guile in >1 preemptible thread doesn't currently work.
For the future, no, it isn't needless.  In other words, I'd say you're
right to be worrying about this.

The initial answer to your question is another question: why do you
want to be playing with the underlying C structure at a time where
there are no more SCM references?

If the answer is that the C structure is also used by older non-Guile
code, there's a description of a solution to this problem in the
latest CVS manual.  See the node `Extending Dia', and especially its
subnode `Dia Smobs'.  Does this help at all?  (Note that it's not
really Dia-specific at all.)

        Neil




reply via email to

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