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 12:18:50 -0500 Message-ID: <293BAADA-EF04-4983-A628-1355BDF964ED@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 1297790381 21203 80.91.229.12 (15 Feb 2011 17:19:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Feb 2011 17:19:41 +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 18:19:36 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 1PpOYn-00080U-9X for guile-devel@m.gmane.org; Tue, 15 Feb 2011 18:19:33 +0100 Original-Received: from localhost ([127.0.0.1]:51950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpOYm-0002tV-No for guile-devel@m.gmane.org; Tue, 15 Feb 2011 12:19:32 -0500 Original-Received: from [140.186.70.92] (port=44169 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpOYj-0002q5-8q for guile-devel@gnu.org; Tue, 15 Feb 2011 12:19:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpOYi-0003f3-Cs for guile-devel@gnu.org; Tue, 15 Feb 2011 12:19:29 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:33344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpOYi-0003et-AB for guile-devel@gnu.org; Tue, 15 Feb 2011 12:19:28 -0500 Original-Received: by vxb41 with SMTP id 41so266571vxb.0 for ; Tue, 15 Feb 2011 09:19:27 -0800 (PST) Original-Received: by 10.220.199.139 with SMTP id es11mr1213428vcb.123.1297790333428; Tue, 15 Feb 2011 09:18:53 -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 n13sm1316977vcr.17.2011.02.15.09.18.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Feb 2011 09:18:52 -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.220.169 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:11650 Archived-At: On Feb 10, 2011, at 17:19, Andy Wingo wrote: >> procproc.c: There's a mutex to protect overrides, but it looks like >> set-procedure-property! doesn't use it correctly; it should look more >> like set-object-property! does. >=20 > I'm going to punt on this one, since it cannot access the hash table = in > an inconsistent state, and I don't care enough about what happens when > multiple threads start changing the same procedure property (a fairly > legacy interface) at once. Furthermore there is always (assq-set! > (procedure-properties foo) 'bar) to contend with... It doesn't need to be the same property; I think different threads = setting different new properties on a procedure in parallel may lose. = Both read the old property list, then each in turn acquires the lock and = sets a new property list consisting of the new property added to the = original list. So the second one "wins", and the first update = disappears. Ken=