Permalink
Browse files

Updated documentation.

  • Loading branch information...
vsedach committed Feb 7, 2011
1 parent 2f7849e commit 0558f0daeb6c41e84e621c0d9a0050faa6bc8223
Showing with 11 additions and 4 deletions.
  1. +5 −1 README
  2. +2 −3 library.lisp
  3. +4 −0 scheduler.lisp
View
6 README
@@ -85,7 +85,7 @@ function force (future &rest values) => nil
macro pexec (&body body) => future
- A shorthand for (pcall (lambda () ...)).
+ Shorthand for (pcall (lambda () ...))
macro plet ((&rest bindings) &body body)
@@ -126,3 +126,7 @@ function select-timeout (timeout &rest futures) => future or nil
macro pfuncall (function &rest args) => result
Evaluates args in parallel before funcalling the given function on them.
+
+function touch (x) => value
+
+ If x is a future, yields its value, otherwise returns x.
View
@@ -1,7 +1,7 @@
(in-package #:eager-future2)
(defmacro pexec (&body body)
- "A shorthand for (pcall (lambda () ...))."
+ "Shorthand for (pcall (lambda () ...))"
`(pcall (lambda () ,@body)))
(defmacro plet ((&rest bindings) &body body)
@@ -78,8 +78,7 @@ elapsed, or the first yieldable future otherwise."
(funcall ,function ,@syms))))
(defun touch (x)
- "If x is a future, yields its value, otherwise returns x.
-Borrowed from MultiLisp."
+ "If x is a future, yields its value, otherwise returns x."
(if (typep x 'future)
(yield x)
x))
View
@@ -29,10 +29,14 @@
(with-recursive-lock-held (*thread-counter-lock*) (incf *total-threads*)))
(defun thread-pool-size ()
+ "Returns the current number of threads in the thread pool. This
+number determines the maximum amount of speculative futures that can
+be computed at the same time."
(with-recursive-lock-held (*thread-counter-lock*)
*total-threads*))
(defun advise-thread-pool-size (new-size)
+ "Attempts to set the amount of threads in the thread pool to given value."
(with-recursive-lock-held (*thread-counter-lock*)
(if (< *total-threads* new-size)
(loop repeat (- new-size *total-threads*) do (make-pool-thread))

0 comments on commit 0558f0d

Please sign in to comment.