From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Julian Graham" Newsgroups: gmane.lisp.guile.devel Subject: Re: srfi-18 requirements Date: Sun, 24 Feb 2008 13:17:11 -0500 Message-ID: <2bc5f8210802241017o46468365j33c329a069d96d33@mail.gmail.com> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1203877058 15113 80.91.229.12 (24 Feb 2008 18:17:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 18:17:38 +0000 (UTC) Cc: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org To: "Neil Jerram" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 24 19:18:00 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 1JTLQG-0007gO-A7 for guile-devel@m.gmane.org; Sun, 24 Feb 2008 19:18:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTLPk-0000Xe-GA for guile-devel@m.gmane.org; Sun, 24 Feb 2008 13:17:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTLPY-0000Sd-1o for guile-devel@gnu.org; Sun, 24 Feb 2008 13:17:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTLPW-0000Rq-O4 for guile-devel@gnu.org; Sun, 24 Feb 2008 13:17:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTLPW-0000Rg-DX for guile-devel@gnu.org; Sun, 24 Feb 2008 13:17:14 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.155]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTLPW-00048z-7z for guile-devel@gnu.org; Sun, 24 Feb 2008 13:17:14 -0500 Original-Received: by fg-out-1718.google.com with SMTP id d23so6469044fga.30 for ; Sun, 24 Feb 2008 10:17:12 -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:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=WO47lmMYyGhY+1pcVEaWxrDPOnktv3qm3PGYEGvK5K4=; b=P8y0Rh2SXNaclB93OGRD8/3z2gx7aacpLve1eD15dIfPtXJillNK2HaH3e+0pAQrUyWA+aMAcxu6aP4xmMqahrlQ0p8jORkR8F+sVNsKzOOUUa/jyECnQ1m24h+JvofkbgJreMvElTqysXHUneVjvuo7eDWm0wSM10zKJl7TAXg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iQcotYAA8IGrJx8hIjunXaQuikFK6QpNlR/mnQYF6G5QxEPqGmF1ewsgLDONC2v3yf2NvAV1iufY4pwaZPhcjN7qC2+YgQZCS1X32uUn869NNIrc1W2B+s3ncUitdW+nQS/mlmGzRah/6kn9kpMne6rlnPGLJv4FOeFSty5zhS4= Original-Received: by 10.82.126.5 with SMTP id y5mr3750987buc.37.1203877031355; Sun, 24 Feb 2008 10:17:11 -0800 (PST) Original-Received: by 10.82.100.9 with HTTP; Sun, 24 Feb 2008 10:17:11 -0800 (PST) In-Reply-To: <87ir0e1yka.fsf@ossau.uklinux.net> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:7046 Archived-At: > 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. > > 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. Regards, Julian