From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Using define in multiple threads? Date: Mon, 17 Nov 2008 21:45:44 +0100 Message-ID: References: <3ae3aa420811161427t6b2c65d1q4adcd6e9a5689ddc@mail.gmail.com> <87od0ee6yl.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1226956208 3761 80.91.229.12 (17 Nov 2008 21:10:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2008 21:10:08 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Nov 17 22:11:10 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L2BN0-0001q0-CB for guile-devel@m.gmane.org; Mon, 17 Nov 2008 22:10:54 +0100 Original-Received: from localhost ([127.0.0.1]:39168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2BLr-0005qL-Pc for guile-devel@m.gmane.org; Mon, 17 Nov 2008 16:09:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2BLp-0005pd-Iq for guile-devel@gnu.org; Mon, 17 Nov 2008 16:09:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2BLm-0005lQ-TT for guile-devel@gnu.org; Mon, 17 Nov 2008 16:09:41 -0500 Original-Received: from [199.232.76.173] (port=60699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2BLm-0005lI-Pg for guile-devel@gnu.org; Mon, 17 Nov 2008 16:09:38 -0500 Original-Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:61611 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2BLe-0007cK-Pn; Mon, 17 Nov 2008 16:09:30 -0500 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by b-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTP id B489716E66; Mon, 17 Nov 2008 16:09:22 -0500 (EST) Original-Received: from unquote (unknown [83.34.179.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by b-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTPSA id C8D1B1586E; Mon, 17 Nov 2008 16:06:25 -0500 (EST) In-Reply-To: <87od0ee6yl.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 17 Nov 2008 15:57:06 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Pobox-Relay-ID: 01D91242-B4EC-11DD-A778-C128113D384A-02397024!a-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7858 Archived-At: Hello! On Mon 17 Nov 2008 15:57, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Han-Wen Nienhuys writes: > >> Linas Vepstas escreveu: >>> Is it "safe" or "legal" to use define in multiple threads? > > Besides, as Linas noted, the hash table implementation isn't > thread-safe, which makes it "unsafe" to `define' in parallel. Ah, this is why, then. I was baffled. IMO this is a bug; Guile can claim that "wierd behavior is expected" when using a data structure from multiple threads in without locking, but in this case the data structure is only being used implicitly. Modules should contain a lock that is taken when they are mutated. This isn't the first time I've wanted a functional hash table implementation... Andy --=20 http://wingolog.org/