lparallel.org - Lisp in Parallel : lparallel | (ql:quickload :lparallel)

Description: (ql:quickload :lparallel)

Example domain paragraphs

lfarm is a distributed version of lparallel which replaces worker threads with remote processes. For example lfarm:pmap will subdivide the input sequence(s), send the parts to remote machines for mapping, and then combine the results. Likewise lfarm:future wraps remote task execution in the metaphor of promises. Most of the lparallel kernel API is retained with minor variations.

Below is another example of Concurrent Hello World . The macros receive and run are just 9 lines each, given below the fold.

(defpackage :example (:use :cl :node)) (in-package :example) (defun hello (hello-queue world-queue) (receive hello-queue (:say-hello (n) (cond ((plusp n) (format t "Hello ") (send world-queue :say-world n)) (t (send world-queue :quit) (return)))))) (defun world (world-queue hello-queue) (receive world-queue (:say-world (n) (format t "World!~%") (send hello-queue :say-hello (- n 1))) (:quit () (return)))) (defun main (n) (let ((hello-queue (make-queue)) (world-queue (make-queue))) (run (make-node 'hello hell