From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Recursive mutexes? Date: 26 Oct 2002 22:39:28 +0100 Sender: guile-devel-admin@gnu.org Message-ID: References: <87r8edos41.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035668452 21758 80.91.224.249 (26 Oct 2002 21:40:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 26 Oct 2002 21:40:52 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 185Yfr-0005eo-00 for ; Sat, 26 Oct 2002 23:40:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 185YfN-0000v6-00; Sat, 26 Oct 2002 17:40:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 185Yes-0000Qb-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 17:39:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 185Yej-0000EM-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 17:39:49 -0400 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 185Yei-0000C0-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 17:39:40 -0400 Original-Received: from laruns.ossau.uklinux.net (bts-0983.dialup.zetnet.co.uk [194.247.51.215]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id g9QLdd127574; Sat, 26 Oct 2002 22:39:39 +0100 Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (localhost [127.0.0.1]) by laruns.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id 342CEDC129; Sat, 26 Oct 2002 22:39:29 +0100 (BST) Original-To: Marius Vollmer In-Reply-To: <87r8edos41.fsf@zagadka.ping.de> Original-Lines: 41 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1606 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1606 >>>>> "Marius" == Marius Vollmer writes: Marius> Our current coop mutexes are not 'recursive'. This means that a Marius> thread blocks when it tries to lock a mutex that it already has Marius> locked. Marius> I think we should make our mutexes be recursive by default. Expecting Marius> to block when locking a mutex that is already lcoked by one self is Marius> not very useful, since no one can unlock that mutex (excepts asyncs). True, but a situation like this (the same thread trying to relock the same mutex) can alert you to a programming error. A dramatic problem (the program hanging) is often more useful than the error being hidden. Marius> The only good argument against recursive mutexes that I can think of Marius> is a tiny performance gain since you don't need to do some checking. IIRC, it's easy to implement a recursive mutex if you already have a non-recursive one, but the reverse is not so easy. Marius> SRFI-18 specifies non-recursive mutexes and allows non-owning threads Marius> to unlock a mutex. On first hearing, this sounds like it could be a useful feature. Marius> Such uses of a mutex are, in my view, a mockery of Marius> condition variables should be avoided. I think you'll have to rephrase that! :-) Marius> If non-recursive mutexes turn out to be important, we can provide them Marius> as well, as an option. I'm pretty sure they are important (enough), so I suggest that we provide both. What would be quite nice (and I think is possible) would be to implement non-recursive mutexes in a thread-implementation-specific way, and then recursive mutexes in a generic way based on whatever non-recursive mutex is currently configured. Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel