From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: Recursive mutexes? Date: 27 Oct 2002 02:35:54 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <871y6cpvkl.fsf@zagadka.ping.de> References: <87r8edos41.fsf@zagadka.ping.de> <87hef86e3d.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035679073 14741 80.91.224.249 (27 Oct 2002 00:37:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 27 Oct 2002 00:37:53 +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 185bR9-0003pV-00 for ; Sun, 27 Oct 2002 02:37: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 185bPT-0007QF-00; Sat, 26 Oct 2002 20:36:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 185bPJ-0007Ir-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 20:35:57 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 185bPH-0007Fg-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 20:35:56 -0400 Original-Received: from mail.dokom.net ([195.253.8.218]) by monty-python.gnu.org with esmtp (Exim 4.10) id 185bPH-0007EF-00 for guile-devel@gnu.org; Sat, 26 Oct 2002 20:35:55 -0400 Original-Received: from dialin.speedway42.dip231.dokom.de ([195.138.42.231] helo=zagadka.ping.de ident=qmailr) by mail.dokom.net with smtp (Exim 3.32 #2) id 185bPu-0004uP-00 for guile-devel@gnu.org; Sun, 27 Oct 2002 02:36:34 +0200 Original-Received: (qmail 14714 invoked by uid 1000); 27 Oct 2002 00:35:54 -0000 Original-To: Rob Browning In-Reply-To: <87hef86e3d.fsf@raven.i.defaultvalue.org> Original-Lines: 34 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 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:1616 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1616 Rob Browning writes: > > I think we should make our mutexes be recursive by default. Expecting > > to block when locking a mutex that is already lcoked by one self is > > not very useful, since no one can unlock that mutex (excepts asyncs). > > Though people coming from POSIX threads (at least under glibc) will > be used to having to explicitly ask for recursive mutexes, I am confused by the libc docs: what is a "timed" mutex? Is it recursive or not? I just checked a little test program and the default pthread mutexes seem to be recursive, on GNU/Linux. "Fast" mutixes are not resursive but you have to ask for them. > Would it be hard to provide both and let the user select at creation > time? No. But what about having two sets of locking/unlocking functions: one that behaves recursivly, and one that doesn't? > > SRFI-18 specifies non-recursive mutexes and allows non-owning threads > > to unlock a mutex. Such uses of a mutex are, in my view, a mockery of > > condition variables should be avoided. > > Well you certainly could use a condition variable instead of a mutex > here, but I would suspect that in cases where you just want to wake > someone else up, a mutex others can unlock would be lighter weight. > With a condition variable you have to have both a mutex and the > condition variable. And for a good reason, no? -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel