From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Thompson Newsgroups: gmane.lisp.guile.devel Subject: Re: Concurrent MVars for Guile Date: Wed, 04 Sep 2013 22:10:58 -0400 Message-ID: <5227E832.9050408@worcester.edu> References: <87fvtn1wv8.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1378347079 27428 80.91.229.3 (5 Sep 2013 02:11:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Sep 2013 02:11:19 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Sep 05 04:11:21 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VHP2X-0006Bh-2d for guile-devel@m.gmane.org; Thu, 05 Sep 2013 04:11:21 +0200 Original-Received: from localhost ([::1]:56575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHP2W-0003do-Hd for guile-devel@m.gmane.org; Wed, 04 Sep 2013 22:11:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHP2L-0003cm-4I for guile-devel@gnu.org; Wed, 04 Sep 2013 22:11:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHP2C-0000Xd-2p for guile-devel@gnu.org; Wed, 04 Sep 2013 22:11:09 -0400 Original-Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]:48343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHP2B-0000WP-RL for guile-devel@gnu.org; Wed, 04 Sep 2013 22:11:00 -0400 Original-Received: from mail-qc0-f178.google.com ([209.85.216.178]) (using TLSv1) by na3sys009aob119.postini.com ([74.125.148.12]) with SMTP ID DSNKUifoMaD53EkCYgcTiRluvSQVCd14Lr9j@postini.com; Wed, 04 Sep 2013 19:10:59 PDT Original-Received: by mail-qc0-f178.google.com with SMTP id r5so641627qcx.37 for ; Wed, 04 Sep 2013 19:10:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=oWbT1+YUCN7U8kEQk4TUPNRTWe+uWNwuzCH2hneCvYM=; b=AdAKseNeRxj+0rqqQuxsvxpoczXh1ebPUFfWdr0heT5MkxfQYGMtqWteobQo3cyFji GxKrHmZSbi5lPtc/njmC5LUrCSBmpwfyPwpNuUzv5ydnOo7q7jFlhe0Y0chhLFNlMjK5 ZpLpQRPdv6BrRhhghxP3DXJzD4s7m3SNFKJ3Vi1tLzJXvjx6aZzOVwuj5YgHceG6cg7q PK8Mh4eNysbsdRi3i2hgAg3PMsCAX2l/QzJVQukWBARq/SxnaXnZwokogxqCQ6hQt3DL ckqT45IBmBbTECr5hcK4P2G/XAhsyN+xnzIwUNjO0sGAgBndq+SIShaQm3ljD051JlZm Y53g== X-Gm-Message-State: ALoCoQmISQcbSnTWQXuWKNQ6BnHzHBDUnda00MpHSsrLe+u5hEUE+FPkNEJoLWg7w847DvNVqE0gnfjNXAWJeRHMV1s2I1QGINP8p9sQe2jnegBqnQ3fUycrTQapL5qHFV+OH+6F/v092Vjp6MuqYtp1G1dWB4M3PA== X-Received: by 10.224.136.1 with SMTP id p1mr7193723qat.25.1378347056800; Wed, 04 Sep 2013 19:10:56 -0700 (PDT) X-Received: by 10.224.136.1 with SMTP id p1mr7193720qat.25.1378347056726; Wed, 04 Sep 2013 19:10:56 -0700 (PDT) Original-Received: from [192.168.1.111] (c-71-232-35-199.hsd1.ma.comcast.net. [71.232.35.199]) by mx.google.com with ESMTPSA id j11sm38136012qaa.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 19:10:56 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 In-Reply-To: <87fvtn1wv8.fsf@tines.lan> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 74.125.149.246 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16612 Archived-At: On 09/02/2013 03:55 AM, Mark H Weaver wrote: > Hello all, > > I've attached a preliminary implementation of MVars à la Concurrent > Haskell for Guile. I made a few small changes to the API to better > match Scheme conventions, and added atomicity guarantees for 'read-mvar' > and 'swap-mvar'. I also added the interface 'try-read-mvar'. > > Note that the fairness of this implementation relies upon the fairness > of Guile's mutexes and condition variables, which I have not checked. > > Comments and suggestions welcome. > > I was thinking that maybe we should add something like this to core > Guile. What do you think? > > Mark > > I am using this for my game library, guile-2d (the first version that you posted). A user ran into trouble installing guile-2d because of an error with case-lambda in this module. They are using Guile 2.0.7. Thoughts? ~/Downloads/guile-2d $ make GEN2d/game-loop.go ice-9/boot-9.scm:106:20: In procedure#: ice-9/boot-9.scm:106:20: Syntax error: 2d/mvars.scm:52:2: case-lambda: badcase-lambda in form(case-lambda "Return a freshly allocated mvar. The optional argument, if provided,\nspecifies the initial contents of the mvar, otherwise it will be empty." (() (make-mvar#f #t (make-mutex) (make-condition-variable))) ((x) (make-var x #f (make-mutex) (make-condition-variable)))) make: *** [2d/game-loop.go] Error 1