From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: Thread and guile environment Date: Fri, 09 Jul 2010 21:23:59 +0100 Message-ID: <87630oe74w.fsf@ossau.uklinux.net> References: <20100705082310.GA9492@apc> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278707123 31842 80.91.229.12 (9 Jul 2010 20:25:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Jul 2010 20:25:23 +0000 (UTC) Cc: guile-user@gnu.org To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jul 09 22:25:22 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OXK8L-0001L0-J6 for guile-user@m.gmane.org; Fri, 09 Jul 2010 22:25:17 +0200 Original-Received: from localhost ([127.0.0.1]:37206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXK8L-0001lx-1t for guile-user@m.gmane.org; Fri, 09 Jul 2010 16:25:17 -0400 Original-Received: from [140.186.70.92] (port=48502 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXK82-0001hu-Qf for guile-user@gnu.org; Fri, 09 Jul 2010 16:25:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXK7Z-0002fh-QV for guile-user@gnu.org; Fri, 09 Jul 2010 16:24:31 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:42290) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXK7Z-0002Rq-LU for guile-user@gnu.org; Fri, 09 Jul 2010 16:24:29 -0400 Original-Received: from arudy (unknown [92.29.72.223]) by mail3.uklinux.net (Postfix) with ESMTP id 5DAB41F6801; Fri, 9 Jul 2010 21:23:52 +0100 (BST) Original-Received: from arudy (unknown [192.168.11.8]) by arudy (Postfix) with ESMTP id 902A638013; Fri, 9 Jul 2010 21:24:00 +0100 (BST) In-Reply-To: (Andy Wingo's message of "Thu, 08 Jul 2010 20:48:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7982 Archived-At: Andy Wingo writes: > On Mon 05 Jul 2010 09:23, rixed@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