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: thread safe functions Date: Sat, 28 Aug 2010 12:20:31 -0700 Message-ID: References: <20100805112743.GA1671@securactive.net> <8C8EEFE6-77CA-42E7-A2FB-9CEF4E83CDFF@raeburn.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1283023099 12779 80.91.229.12 (28 Aug 2010 19:18:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Aug 2010 19:18:19 +0000 (UTC) Cc: guile-devel Development To: Ken Raeburn Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Aug 28 21:18:16 2010 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.69) (envelope-from ) id 1OpQur-0003VB-Sc for guile-devel@m.gmane.org; Sat, 28 Aug 2010 21:18:15 +0200 Original-Received: from localhost ([127.0.0.1]:54732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpQun-00056n-CX for guile-devel@m.gmane.org; Sat, 28 Aug 2010 15:18:09 -0400 Original-Received: from [140.186.70.92] (port=37650 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpQuK-0004vL-Ey for guile-devel@gnu.org; Sat, 28 Aug 2010 15:17:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OpQtz-0007GD-13 for guile-devel@gnu.org; Sat, 28 Aug 2010 15:17:20 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:42938 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OpQty-0007G5-VZ for guile-devel@gnu.org; Sat, 28 Aug 2010 15:17:18 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 7562DD15C7; Sat, 28 Aug 2010 15:17:18 -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=iQa08L4Ay9KdmFq8JG/HZf8yQp0=; b=UEvB3k IOG2EzBhd95QDcpjHcMyZx9NdymSoLUuHHWP5OV+Fd3ruPXlqSG16iutcoxjPdhQ McOSR5NK4gy3PkQBSJ/ENU42hn+3IyYWwWF0Cg2aO8xZ4QuUQWOXHfoRZFL+YAVC hMeEfig1Zs9YPNXWw9u4yEtzzLAnYQ6a84Byw= 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=UBmKc0MzxDW90B528QQXZplIfvXm+UkS xrpHj1SGiodDquUy9QWsi95pMWZ49PfJDXeVZEfQXthEBhxpNyn+UCZB0pv4QgpE x5RMLq/jl7nHQzYrCVJzOO551xohdS/WorRf2liB72fDyQ4e85Bp0Op2OFnyVW95 MVeK/A/KRrc= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 613F7D15C5; Sat, 28 Aug 2010 15:17:17 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [75.28.21.123]) (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 7DFC6D15C3; Sat, 28 Aug 2010 15:17:15 -0400 (EDT) In-Reply-To: <8C8EEFE6-77CA-42E7-A2FB-9CEF4E83CDFF@raeburn.org> (Ken Raeburn's message of "Sat, 21 Aug 2010 20:57:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: DF4C3474-B2D8-11DF-AEF4-030CEE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.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:10804 Archived-At: Hi Ken, On Sat 21 Aug 2010 17:57, Ken Raeburn writes: > On Aug 18, 2010, at 11:56, Andy Wingo wrote (quoting the manual): >> Thus, you need to put in additional synchronizations when multiple >> threads want to use a single hashtable, or any other mutable Scheme >> object. > > Unfortunately this applies to some internals of the implementation too. > For example, "set-object-property!" and friends use a hash table and > assoc lists internally. Fixed, thanks. > scm_c_issue_deprecation_warning and scm_c_register_extension don't look > thread-safe to me (in the sense described above). Fixed also. > That's just from a spot check; I'm not even trying to be thorough. I await your more thorough check :) > And don't get me going on memory ordering models.... I'm interested! > To be honest, I wouldn't trust libguile in a multithreaded application > without much more careful analysis, not just of the code, but of the > assumptions being made and whether they're actually valid for various > processors (not just the relatively friendly x86) and compilers. > Without that sort of analysis, I think "use mutexes everywhere" is the > only safe approach, and libguile certainly isn't doing that. I think we agree, but I prefer to paint this in a more optimistic light -- that things are mostly there, but bugs are possible. Bug fixes are also possible :) Cheers, Andy -- http://wingolog.org/