guile-user
[Top][All Lists]
Advanced

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

Re: libguile thread safety


From: Panicz Maciej Godek
Subject: Re: libguile thread safety
Date: Sat, 4 Jan 2014 16:01:35 +0100

2014/1/4 Chris Vine <address@hidden>:
> There is something even more bizarre than as reported in the exchange
> with Maciej.  The further test case below prints:
>
>   Hello
>   20
>   20
>
> I would have expected:
>
>   Hello
>   10
>   20
>
> It seems as if top level variables in code evaluated by scm_c_eval_string()
> are shared between concurrently running threads.  Is this really the
> intended behaviour (it is a significant and unexpected usability
> restriction)?  Maciej (I hope that is your first name) can you reproduce
> this?

Yes, I confirm that the output with my setup is

Hello
20
20

It indeed does seem that the threads share their top-level bindings on
guile's side, and I suppose that this is the intended behaviour. I
think that it can be easily adjusted with scm_eval_string_in_module,
i.e. if you provide a separate module for each thread.



reply via email to

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