From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Thread and guile environment Date: Thu, 08 Jul 2010 20:48:33 +0100 Message-ID: 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 1278682610 11410 80.91.229.12 (9 Jul 2010 13:36:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Jul 2010 13:36:50 +0000 (UTC) Cc: guile-user@gnu.org To: rixed@happyleptic.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jul 09 15:36:48 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 1OXDl0-0008So-GW for guile-user@m.gmane.org; Fri, 09 Jul 2010 15:36:46 +0200 Original-Received: from localhost ([127.0.0.1]:48708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXDkz-00013e-Tz for guile-user@m.gmane.org; Fri, 09 Jul 2010 09:36:46 -0400 Original-Received: from [140.186.70.92] (port=36420 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXDk5-0000pT-1q for guile-user@gnu.org; Fri, 09 Jul 2010 09:35:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXDk0-0007ve-Un for guile-user@gnu.org; Fri, 09 Jul 2010 09:35:48 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:43004 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXDk0-0007pB-T2 for guile-user@gnu.org; Fri, 09 Jul 2010 09:35:44 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 7C5CDC24F2; Fri, 9 Jul 2010 09:35:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=bzxXLxOls/EniEiUJKO3gDBZk20=; b=Akwq2M o2Oau6Y2jAAgB5syGAgsOChGKBDYZGIcv8MoIDNj4MAw2icHjUX/MyzICAnDl1Ht 9F9m93pIfWDpxk3+qvzGMxBZrTLRlQkmK/NX+lcEKmsglxOo2jCfGsX0yglmQAwh M+ZD/A0CvPdazFoM4ITytFgGOKTcbx8H+VePo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=OM7zVkpg0cVpTHqBExiXvH3KfO0H8ajo S4p6iYDnVaNYttNVGRoBllna73cOM24p+tgcF+jKanwoB1f76t4GGJL37FpHnvtY JgfnvTI1ybIW8FLdQuAsl0yxr3FvUQIcC4Iw7RGgjOmHhGm2kSXHRl8bA1acuw7o 06nHUQcR9eU= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 5B372C24F1; Fri, 9 Jul 2010 09:35:08 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [81.39.161.70]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 7B396C24F0; Fri, 9 Jul 2010 09:35:05 -0400 (EDT) In-Reply-To: <20100705082310.GA9492@apc> (rixed@happyleptic.org's message of "Mon, 5 Jul 2010 10:23:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: CA689602-8B5E-11DF-A439-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:7978 Archived-At: 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. 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? Andy -- http://wingolog.org/