From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: Recursive mutexes? Date: Sun, 27 Oct 2002 12:44:55 -0600 Sender: guile-devel-admin@gnu.org Message-ID: <874rb7en6g.fsf@raven.i.defaultvalue.org> References: <87r8edos41.fsf@zagadka.ping.de> <87hef86e3d.fsf@raven.i.defaultvalue.org> <871y6cpvkl.fsf@zagadka.ping.de> <871y6c5whm.fsf@raven.i.defaultvalue.org> <87iszonmm2.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 1035744383 6052 80.91.224.249 (27 Oct 2002 18:46:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 27 Oct 2002 18:46:23 +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 185sQY-0001ZU-00 for ; Sun, 27 Oct 2002 19:46:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 185sQN-0003F0-00; Sun, 27 Oct 2002 13:46:11 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 185sPI-000122-00 for guile-devel@gnu.org; Sun, 27 Oct 2002 13:45:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 185sPA-0000vJ-00 for guile-devel@gnu.org; Sun, 27 Oct 2002 13:45:03 -0500 Original-Received: from n66644228.ipcdsl.net ([66.64.4.228] helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 185sPA-0000vF-00 for guile-devel@gnu.org; Sun, 27 Oct 2002 13:44:56 -0500 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id 10C3917EA; Sun, 27 Oct 2002 12:44:56 -0600 (CST) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id CB554653; Sun, 27 Oct 2002 12:44:55 -0600 (CST) Original-To: Marius Vollmer In-Reply-To: <87iszonmm2.fsf@zagadka.ping.de> (Marius Vollmer's message of "27 Oct 2002 12:32:21 +0100") Original-Lines: 25 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-pc-linux-gnu) 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:1630 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1630 Marius Vollmer writes: > I meant: there is a good reason that waiting on a condition variable > requires you to have a locked mutex that is the atomically unlocked. > Without this, I guess you will have a hard time avoiding race > conditions. Using mutexes in a strange way to simulate this is > probably wrong. Ahh, right. I presume you mean the deadlock case of blocking after you've already been signalled -- yeah mutexes (at least posix style) aren't the best thing there, but I'd generally use a 0 token sempahore for that. Then if you're the one about to block, the signaller will either already have deposited the token, or will after you block. I have to keep reminding myself that mutexes aren't semaphores here. I keep forgetting that because I did a whole lot of thread programming in a system where we arranged for mutexes to be a special case (one-token) semaphore. This meant it was supposed to be OK for others to signal, etc. -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel