Andy Wingo <wi...@pobox.com> writes: > On Mon 05 Jul 2010 09:23, ri...@happyleptic.org writes: > >> Suppose I have a multithreaded C program. Isn't the guile environment >> supposed >> to be shared amongst all threads ? That's what I understood from reading the >> docs anyway. >> >> Yet this simple exemple shows the opposite (see the 3 attached files). >> So am I supposed to source my global scheme definitions in all threads >> ? > > Interestingly, the first thread has you in (guile-user), but the second > has you in (guile). So you don't see the full definition of format, nor > do you see hug.
That's what I thought too. But in that case I have no idea why my '(define-module (guile-user))' suggestion didn't work. > But it's quite ugly. Does anyone have any input as to what module should > be current when a thread previously unknown to Guile enters Guile? Surely it has to be (guile-user), since that what the end of boot-9.scm moves into - and hence is well-established for the single thread case. I suspect that a program that calls scm_with_guile() on multiple threads can't necessarily predict which of the threads will perform the Guile startup. Neil