Common Lisp Package: PARALLEL

README:

FUNCTION

Public

FUTURE-FINISHED-P (F)

Return true iff the argument is a live thread

FUTURE-P (F)

Test whether or not a value is a future.

PAR-EVERY (PRED XS &KEY (MAX-THREADS 4) (SLEEP-TIME 0))

Given a predicate and a list, will determine if every element of the list satisfies that predicate.

PAR-FIND (ITEM XS &KEY (MAX-THREADS 4) FROM-END)

Given an item and a list, will return that item if it is found, nil otherwise.

PAR-FIND-IF (PRED XS &KEY (MAX-THREADS 4) (KEY NIL KEY-P) FROM-END)

Given a predicate and a list, will return the first element in the list that satisfies that predicate.

PAR-MAP (F XS &KEY (MAX-THREADS 4) (SLEEP-TIME 0))

This function computes a function upon a list in parallel.

PAR-MAP-CHUNKED (F XS &KEY (CHUNK-SIZE 1) (MAX-THREADS 4) (SLEEP-TIME 0))

Break a list up into `size` chunks, and process those chunks in parallel.

PAR-MAP-REDUCE (MAP-FN REDUCE-FN XS &KEY (MAX-THREADS 4) (SLEEP-TIME 0) INITIAL-VALUE)

Given a mapping function, reducing function, and list, will map the values accross the list in parallel, then reduce them in the order that the computations finish.

PAR-SOME (PRED XS &KEY (MAX-THREADS 4) (SLEEP-TIME 0))

Given a predicate and a list, return true if at least one element in the list satifies the predicate.

REALIZE (F)

Force a future to be evaluated, or return nil if the value is not a future.

REALIZE-IF-FINISHED (F)

If the future is finished, return the value; if the future is still running, return the future; if the value is not a future, return it.

Private

PARTITION-IF (PRED XS)

Given a predicate and a list, will return a list with the first element being all of the elements that satisfy the predicate, and the second element being all of the elements that do not satisfy the predicate.

MACRO

Public

FUTURE (&REST BODY)

This macro essentially creates a new future type -- a computation that happens seperately from the rest of the program, and may or may not be finished

PAR-CALLS (&REST CALLS)

Make multiple calls in parallel.

Private

Undocumented

WITH-SEQUENTIAL-THREAD-QUEUE (LST (TO-DO RUNNING) &KEY (MAX-THREADS 4) DONE DOWN UP)

WITH-THREAD-QUEUE (LST (IN OUT) &KEY (MAX-THREADS 4) (SLEEP-TIME 0) DONE DOWN UP)