[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Concurrent MVars for Guile
From: |
David Thompson |
Subject: |
Re: Concurrent MVars for Guile |
Date: |
Wed, 04 Sep 2013 22:10:58 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 |
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#<procedure 9f50900 at
ice-9/boot-9.scm:97:6 (thrown-k . args)>:
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