2014/1/4 Chris Vine <ch...@cvine.freeserve.co.uk>: > 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.