[Top][All Lists]

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

Re: Thread and guile environment

From: Andy Wingo
Subject: Re: Thread and guile environment
Date: Thu, 08 Jul 2010 20:48:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Mon 05 Jul 2010 09:23, address@hidden 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.

A workaround is to do:

        scm_with_guile(hug_me, "(begin (set-current-module (resolve-module 
'(guile-user))) (hug 2))");

instead of

        scm_with_guile(hug_me, "(hug 2)");

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?


reply via email to

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