guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-13-223-g7


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-13-223-g7bc8b4a
Date: Fri, 17 Dec 2010 21:05:43 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=7bc8b4afa2d67a89372e28fdf65cae8c5aab5997

The branch, master has been updated
       via  7bc8b4afa2d67a89372e28fdf65cae8c5aab5997 (commit)
       via  831ed60ddb8134d90b1f8ae7cebbe60f44570d30 (commit)
       via  90b2c69c9754c96478e8230e9413ca08a2cca576 (commit)
       via  3e0e4f1d873c3fb3ab75ba42acdad822a1aad1a5 (commit)
      from  863f11969d2da23406e3f38842e6b08a87452ef6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7bc8b4afa2d67a89372e28fdf65cae8c5aab5997
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 17 21:57:19 2010 +0100

    Bump version number for 1.9.14.
    
    * GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

commit 831ed60ddb8134d90b1f8ae7cebbe60f44570d30
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 17 21:48:16 2010 +0100

    Tweak `NEWS'.
    
    * NEWS: Update.

commit 90b2c69c9754c96478e8230e9413ca08a2cca576
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 17 21:23:23 2010 +0100

    futures: Store pending futures in a queue.
    
    * module/ice-9/futures.scm (%futures): Change from a list to a queue.
      (register-future!, process-futures, touch): Adjust accordingly.
      (unregister-future!): Remove.

commit 3e0e4f1d873c3fb3ab75ba42acdad822a1aad1a5
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 17 21:17:42 2010 +0100

    Clarify doc regarding threading of `par-map' and `par-for-each'.
    
    * doc/ref/api-scheduling.texi (Parallel Forms): Refine wording for
      `par-map' and `par-for-each'.

-----------------------------------------------------------------------

Summary of changes:
 GUILE-VERSION               |    2 +-
 NEWS                        |   13 ++++++++-
 doc/ref/api-scheduling.texi |    3 +-
 module/ice-9/futures.scm    |   56 +++++++++++++++++++-----------------------
 4 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/GUILE-VERSION b/GUILE-VERSION
index 49f98a7..c0a2dd2 100644
--- a/GUILE-VERSION
+++ b/GUILE-VERSION
@@ -3,7 +3,7 @@
 # Note: `GUILE_VERSION' is defined in `configure.ac' using `git-version-gen'.
 GUILE_MAJOR_VERSION=1
 GUILE_MINOR_VERSION=9
-GUILE_MICRO_VERSION=13
+GUILE_MICRO_VERSION=14
 
 GUILE_EFFECTIVE_VERSION=2.0
 
diff --git a/NEWS b/NEWS
index 55fb271..045d1ef 100644
--- a/NEWS
+++ b/NEWS
@@ -89,19 +89,28 @@ login.  Use `(passwd:name (getpwuid (geteuid)))' instead.
 See "Module System Reflection" and "Module Commands" in the manual, for
 more information.
 
+** New `,in' REPL command
+
+See "Module Commands" in the manual, for more information.
+
 ** Allow user-defined REPL meta-commands
     
-See FIXME in the manual, for more information.
+This feature is not documented yet.  See `define-meta-command' in
+`(system repl command)'.
 
 ** Add support for unbound fluids
     
 See `make-unbound-fluid', `fluid-unset!', and `fluid-bound?' in the
 manual.
 
-** Add variable-unset!
+** Add `variable-unset!'
     
 See "Variables" in the manual, for more details.
 
+** New procedures: `compose', `negate', and `const'
+
+See "Higher-Order Functions" in the manual, for more information.
+
 ** Command line additions
 
 The guile binary now supports a new switch "-x", which can be used to
diff --git a/doc/ref/api-scheduling.texi b/doc/ref/api-scheduling.texi
index a3bef74..248d8b7 100644
--- a/doc/ref/api-scheduling.texi
+++ b/doc/ref/api-scheduling.texi
@@ -952,7 +952,8 @@ calls to complete.
 The @var{proc} calls are @code{(@var{proc} @var{elem1} @dots{}
 @var{elemN})}, where each @var{elem} is from the corresponding
 @var{lst}.  Each @var{lst} must be the same length.  The calls are
-made in parallel, each in its own thread.
+potentially made in parallel, depending on the number of CPU cores
+available.
 
 These functions are like @code{map} and @code{for-each} (@pxref{List
 Mapping}), but make their @var{proc} calls in parallel.
diff --git a/module/ice-9/futures.scm b/module/ice-9/futures.scm
index 742e124..1aebaa6 100644
--- a/module/ice-9/futures.scm
+++ b/module/ice-9/futures.scm
@@ -19,7 +19,7 @@
 (define-module (ice-9 futures)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
-  #:use-module (ice-9 match)
+  #:use-module (ice-9 q)
   #:export (future make-future future? touch))
 
 ;;; Author: Ludovic Courtès <address@hidden>
@@ -63,21 +63,17 @@ touched."
 ;;; Future queues.
 ;;;
 
-(define %futures '())
+(define %futures (make-q))
 (define %futures-mutex (make-mutex))
 (define %futures-available (make-condition-variable))
 
 (define (register-future! future)
   ;; Register FUTURE as being processable.
   (lock-mutex %futures-mutex)
-  (set! %futures (cons future %futures)) ;; FIXME: use a FIFO
+  (enq! %futures future)
   (signal-condition-variable %futures-available)
   (unlock-mutex %futures-mutex))
 
-(define (unregister-future! future)
-  ;; Assume %FUTURES-MUTEX is taken.
-  (set! %futures (delq future %futures)))
-
 (define (process-future! future)
   ;; Process FUTURE, assuming its mutex is already taken.
   (set-future-result! future
@@ -98,29 +94,27 @@ touched."
   (let loop ()
     (wait-condition-variable %futures-available
                              %futures-mutex)
-    (match %futures
-      (() (loop))
-      ((future _ ...)
-       (lock-mutex (future-mutex future))
-       (or (and (future-done? future)
-                (unlock-mutex (future-mutex future)))
-           (begin
-             ;; Do the actual work.
-             (unregister-future! future)
-
-             ;; We want to release %FUTURES-MUTEX so that other workers
-             ;; can progress.  However, to avoid deadlocks, we have to
-             ;; unlock FUTURE as well, to preserve lock ordering.
-             (unlock-mutex (future-mutex future))
-             (unlock-mutex %futures-mutex)
-
-             (lock-mutex (future-mutex future))
-             (or (future-done? future)            ; lost the race?
-                 (process-future! future))
-             (unlock-mutex (future-mutex future))
-
-             (lock-mutex %futures-mutex)))
-       (loop)))))
+    (or (q-empty? %futures)
+        (let ((future (deq! %futures)))
+          (lock-mutex (future-mutex future))
+          (or (and (future-done? future)
+                   (unlock-mutex (future-mutex future)))
+              (begin
+                ;; Do the actual work.
+
+                ;; We want to release %FUTURES-MUTEX so that other workers
+                ;; can progress.  However, to avoid deadlocks, we have to
+                ;; unlock FUTURE as well, to preserve lock ordering.
+                (unlock-mutex (future-mutex future))
+                (unlock-mutex %futures-mutex)
+
+                (lock-mutex (future-mutex future))
+                (or (future-done? future)            ; lost the race?
+                    (process-future! future))
+                (unlock-mutex (future-mutex future))
+
+                (lock-mutex %futures-mutex)))))
+    (loop)))
 
 (define (touch future)
   "Return the result of FUTURE, computing it if not already done."
@@ -132,7 +126,7 @@ touched."
         (unlock-mutex (future-mutex future))
 
         (lock-mutex %futures-mutex)
-        (unregister-future! future)
+        (q-remove! %futures future)
         (unlock-mutex %futures-mutex)
 
         (lock-mutex (future-mutex future))


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]