From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.lisp.guile.devel Subject: Re: thread safe functions Date: Tue, 15 Feb 2011 11:00:51 -0500 Message-ID: <843F92D9-F5DF-42E3-848E-31EC03C1428F@raeburn.org> References: <20100805112743.GA1671@securactive.net> <8C8EEFE6-77CA-42E7-A2FB-9CEF4E83CDFF@raeburn.org> <5105E811-5A0E-4D7B-9A4A-D3DABB12406F@raeburn.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1297785670 23715 80.91.229.12 (15 Feb 2011 16:01:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Feb 2011 16:01:10 +0000 (UTC) Cc: guile-devel Development To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 15 17:01:06 2011 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 1PpNKr-0001PF-37 for guile-devel@m.gmane.org; Tue, 15 Feb 2011 17:01:05 +0100 Original-Received: from localhost ([127.0.0.1]:43757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpNKq-0005k6-DB for guile-devel@m.gmane.org; Tue, 15 Feb 2011 11:01:04 -0500 Original-Received: from [140.186.70.92] (port=42907 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpNKk-0005iJ-18 for guile-devel@gnu.org; Tue, 15 Feb 2011 11:00:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpNKi-0002xS-40 for guile-devel@gnu.org; Tue, 15 Feb 2011 11:00:57 -0500 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:41550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpNKi-0002ww-06 for guile-devel@gnu.org; Tue, 15 Feb 2011 11:00:56 -0500 Original-Received: by qyk10 with SMTP id 10so253568qyk.0 for ; Tue, 15 Feb 2011 08:00:54 -0800 (PST) Original-Received: by 10.224.73.193 with SMTP id r1mr738584qaj.167.1297785654621; Tue, 15 Feb 2011 08:00:54 -0800 (PST) Original-Received: from squish.raeburn.org (c-24-128-190-224.hsd1.ma.comcast.net [24.128.190.224]) by mx.google.com with ESMTPS id s10sm2744590qco.11.2011.02.15.08.00.52 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Feb 2011 08:00:53 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.176 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:11648 Archived-At: On Feb 10, 2011, at 17:19, Andy Wingo wrote: > Hey Ken, >=20 > I got tired of seeing your mail marked as starred in my inbox, so I > decided to take a look at it ;-) Thanks! :-) I'm sorry I haven't had time in a while to investigate more. >> symbols.c: I don't think 'symbols' is handled safely. But this code = is >> all starting to run together in my mind. :-) >=20 > I think I fixed this one a month ago or so. Hmm... maybe. It looks to me like it'll probably be okay, *if* you = assume that updates aren't seen out-of-order by another thread. If = updates can be seen out of order, then the newly allocated vector in = scm_i_rehash may still be seen as having garbage values in its data = slots by the time SCM_SET_HASHTABLE_VECTOR makes it visible to other = threads that aren't using any synchronization primitives. BTW, I like this writeup: = http://www.cs.umd.edu/~pugh/java/memoryModel/AlphaReordering.html . It = shows how (on Alpha, with its weak memory ordering model) even an = explicit memory barrier in the writing thread isn't enough to guarantee = that a reading thread in another CPU will see changes "in order". > At this point I got tired. But sending this mail to the list will > requeue this work, so hey... Fair enough. :) Ken=