Skip to content
Common Lisp library to evaluate some forms in parallel
Common Lisp
Branch: master
Clone or download
Latest commit db460f7 Oct 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Sep 12, 2019
README.org Add tests Oct 9, 2019
simple-parallel-tasks-tests.asd Add tests Oct 9, 2019
simple-parallel-tasks-tests.lisp Add tests Oct 9, 2019
simple-parallel-tasks.asd Add tests Oct 9, 2019
simple-parallel-tasks.lisp Make a variable name more explicit Sep 13, 2019

README.org

simple-parallel-tasks

This is a simple Common Lisp library to evaluate some forms in parallel.

Installation

simple-parallel-tasks requires the chanl library.

With Quicklisp

(ql:quickload "simple-parallel-tasks")

With ASDF

Put the directories of simple-parallel-tasks and the dependencies where ASDF can find them and use:

(asdf:load-system "simple-parallel-tasks")

API

(defmacro plist (&rest forms))

Evaluate forms in parallel and return the results in a list.

(defmacro pvalues (&rest forms))

Evaluate forms in parallel and return the results as multiple values.

(defmacro plet (bindings &body body))

Like let, but the bindings are evaluated in parallel.

Examples

(time (simple-parallel-tasks:plist 1 (+ 4 5) (sleep 2) 8 (sleep 1) (/ 3 5)))

Evaluation took:
  2.004 seconds of real time

(1 9 NIL 8 NIL 3/5)
(time (simple-parallel-tasks:pvalues 1 (+ 4 5) (sleep 2) 8 (sleep 1) (/ 3 5)))

Evaluation took:
  2.007 seconds of real time

1
9
NIL
8
NIL
3/5
(time (simple-parallel-tasks:plet ((x (sleep 2))
                                   (y (+ 3 4))
                                   a
                                   (b (sleep 3))
                                   (z (floor 12 5)))
        (list x y a b z)))

Evaluation took:
  3.0000 seconds of real time

(NIL 7 NIL NIL 2)

Tests

The tests require the fiveam library.

(asdf:test-system "simple-parallel-tasks")
You can’t perform that action at this time.