From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: srfi-18 requirements Date: Sun, 24 Feb 2008 23:29:01 +0000 Message-ID: <873ariaq82.fsf@ossau.uklinux.net> References: <2bc5f8210710101854m1254160ei451026182b87e767@mail.gmail.com> <87fxw55zm0.fsf@ossau.uklinux.net> <871w7os5gn.fsf@ossau.uklinux.net> <2bc5f8210802071604s2519d5c5qa6035426de62f29@mail.gmail.com> <2bc5f8210802102114m4eab895dr3114b7ea74156b38@mail.gmail.com> <87pruso94g.fsf@ossau.uklinux.net> <2bc5f8210802191810v729d8fa5jec070d3ee4358493@mail.gmail.com> <87r6f5zv6t.fsf@ossau.uklinux.net> <2bc5f8210802212014o45a9c79dpd688f11726a1e159@mail.gmail.com> <87ir0e1yka.fsf@ossau.uklinux.net> <2bc5f8210802241017o46468365j33c329a069d96d33@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203895777 9385 80.91.229.12 (24 Feb 2008 23:29:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 23:29:37 +0000 (UTC) Cc: =?iso-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org To: "Julian Graham" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 25 00:30:02 2008 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.50) id 1JTQI9-000569-4t for guile-devel@m.gmane.org; Mon, 25 Feb 2008 00:29:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTQHd-0006NO-Eq for guile-devel@m.gmane.org; Sun, 24 Feb 2008 18:29:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTQHX-0006LD-I8 for guile-devel@gnu.org; Sun, 24 Feb 2008 18:29:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTQHW-0006Jo-Ac for guile-devel@gnu.org; Sun, 24 Feb 2008 18:29:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTQHW-0006JT-4j for guile-devel@gnu.org; Sun, 24 Feb 2008 18:29:18 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTQHR-0004em-Gd; Sun, 24 Feb 2008 18:29:13 -0500 Original-Received: from arudy (host86-145-183-175.range86-145.btcentralplus.com [86.145.183.175]) by mail3.uklinux.net (Postfix) with ESMTP id 8F0601F67EB; Sun, 24 Feb 2008 23:29:06 +0000 (GMT) Original-Received: from laruns (laruns [192.168.0.10]) by arudy (Postfix) with ESMTP id 2BF183800A; Sun, 24 Feb 2008 23:29:02 +0000 (GMT) In-Reply-To: <2bc5f8210802241017o46468365j33c329a069d96d33@mail.gmail.com> (Julian Graham's message of "Sun, 24 Feb 2008 13:17:11 -0500") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:7048 Archived-At: "Julian Graham" writes: >> Agreed, that's a nice solution. The matter of whether a mutex can be >> unlocked by another thread will depend on an application's design for >> how it uses that mutex, and it feels right for the application to >> declare this when the mutex is created, instead of on every unlock >> call. >> >> On the Scheme level, I think the call can still be `make-mutex', with >> optional flag args - is that right? > > Yes. For C, though, how do you want to manage passing these flags? I > imagine the primitive should be named something like > scm_make_mutex_with_options (or _with_flags), and we could either > require two arguments (each being a symbol option as described below > or SCM_UNDEFINED) or have it take a list containing an arbitrary > number of symbol options to allow us to extend its behavior as > necessary. I didn't get a strong sense of established precedent > looking at Guile's C API; I'm kind of leaning towards the list > approach right now. That sounds great. >> > Actually, I just remembered a fairly elegant approach that seems to be >> > used in other parts of the Guile API -- these optional arguments could >> > be specified as symbols: 'unlock-if-unowned and >> > 'unlock-if-owned-by-other, say. Let me know what you'd prefer. >> >> This is still an interesting question, but now for `make-mutex' >> instead of for `unlock-mutex'. Personally I like the symbol approach, >> because (in comparison with a sequence of #t and #f) it will make the >> code easier to understand at the point of the call, and also because >> the #t/#f approach requires remembering the parameter ordering. > > Cool -- I'll set up make-mutex for Scheme, and for C as described > above. Let me know if that's not okay. All sounds perfect to me. Regards, Neil