From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Linas Vepstas" Newsgroups: gmane.lisp.guile.bugs Subject: Re: [PATCH] Final: thread lock nesting debugging Date: Thu, 20 Nov 2008 12:33:34 -0600 Message-ID: <3ae3aa420811201033g173ffbe6r6b5b0bad6171d9c3@mail.gmail.com> References: <3ae3aa420811162042n4b5d50e3i136a9f7b00262a69@mail.gmail.com> <49dd78620811191514m6e73438esd4f1474c9926880d@mail.gmail.com> <3ae3aa420811200803u485a8fa7ia486c281da54497a@mail.gmail.com> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227206134 19283 80.91.229.12 (20 Nov 2008 18:35:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2008 18:35:34 +0000 (UTC) Cc: bug-guile@gnu.org To: "Neil Jerram" Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Nov 20 19:36:37 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L3EOK-0007Im-Nf for guile-bugs@m.gmane.org; Thu, 20 Nov 2008 19:36:36 +0100 Original-Received: from localhost ([127.0.0.1]:49764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3ENB-0006Nn-J2 for guile-bugs@m.gmane.org; Thu, 20 Nov 2008 13:35:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3ELS-0005ax-Bd for bug-guile@gnu.org; Thu, 20 Nov 2008 13:33:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3ELQ-0005Z5-88 for bug-guile@gnu.org; Thu, 20 Nov 2008 13:33:37 -0500 Original-Received: from [199.232.76.173] (port=47420 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3ELQ-0005Yr-2R for bug-guile@gnu.org; Thu, 20 Nov 2008 13:33:36 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.246]:26008) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3ELP-0004JA-Ja for bug-guile@gnu.org; Thu, 20 Nov 2008 13:33:35 -0500 Original-Received: by an-out-0708.google.com with SMTP id c38so279753ana.21 for ; Thu, 20 Nov 2008 10:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=e9pjASuGyf5iUzYe4EFBNU9A68ppRiuUSbEJNqSA1qY=; b=ocP7wjTLpn+zSlRrD1xgnIvVC601VV2ZLOXcsUjKE6D9EfP2NmDQs1wwDeYDFhUcVE FYFwmjuq1OJ+70ZFYBxmYow6PM2G+tJ9pR4r28urXJ7USKT75hV2Ifvc75niZhEgMm1j +e8sizJ8PZh0eF8U5FYlNx0elUhb7js2pb224= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references; b=Y1et9kNPhcB2CND8KcGUHcSU9F3nl/WVG14ak1VfBl/wk/CKafqU6R74wWQbAlybgQ JM/wv7f0aIA1ITO7vv4/pqj5yWytUIueN6ZF7OZ2QwhoxRAI5sprOxBuBbaOzTAFxIsH hIXT4H7PjfVB6NCKH5FcqLhLDAOXPaV08LMqg= Original-Received: by 10.100.144.11 with SMTP id r11mr1306881and.56.1227206014869; Thu, 20 Nov 2008 10:33:34 -0800 (PST) Original-Received: by 10.100.226.4 with HTTP; Thu, 20 Nov 2008 10:33:34 -0800 (PST) In-Reply-To: <3ae3aa420811200803u485a8fa7ia486c281da54497a@mail.gmail.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4121 Archived-At: 2008/11/20 Linas Vepstas : > -- The reason for dropping the heap_mutex before grabbing > the other lock (for example scm_i_port_table_mutex), > is somewhat obscure, but at one point I decided that this > was OK, and arguably correct. As I write this, I've > forgotten why. However, this should be a focus of attention, > and re-thought-out. Well, a quick look reminds me of the situation: in many/most cases, locked sections might trigger garbage collection. Thus, the heap_mutex *must* be dropped before the lock is taken. My gut impression is that this is a poor design point; and that the correct thing to do would be make locks fine-grained, so that there is never a need to run GC while a lock is held. This would require extensive auditing of the guile code. --linas