guile-user
[Top][All Lists]
Advanced

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

Re: static variables with scheme objects


From: Paul Jarc
Subject: Re: static variables with scheme objects
Date: Wed, 16 Jul 2003 15:20:16 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

sig <address@hidden> wrote:
> In other words, is it ok to say:
>
> mutex_list = scm_permanent_object(scm_list_2(scm_make_mutex(),
>                                              scm_make_mutex()));
>
> or are you required to say
>
> mutex_list = scm_permanent_object(scm_list_2(
>                        scm_permanent_object(scm_make_mutex()),
>                        scm_permanent_object(scm_make_mutex())));

I think the first form is sufficient, but it would be good to hear
from someone more knowlegeable.

> If the garbage collector gets run after scm_make_mutex but before
> scm_permanent_object,

Do you have multiple threads running already when your init function
is called?  If not, there's nothing to worry about; there's nothing in
this thread that will trigger the garbage collector in that window.
If you do have multiple threads already, then I don't know.


paul




reply via email to

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