Next: , Previous: Package FL.ALIEN, Up: Reference manual


7.9 Package FL.MULTIPROCESSING

This package provides an interface for allowing parallel execution in Femlisp. It abstracts also from the underlying Lisp's threading features. Unfortunately, these features somewhat differ (e.g. the waitqueue concept in SBCL and gates in Allegro), although one can usually achieve the same effects.

— Variable: *NUMBER-OF-THREADS*

The number of threads in which Femlisp tries to split the work for some computationally intensive tasks. If NIL, no threading is used.

— Variable: *THREAD-LOCAL-MEMOIZATION-TABLE*

Dynamic variable specialized for each worker thread separately. Should not be used globally.

— Function: CONDITION-NOTIFY WAITQUEUE &OPTIONAL (N 1)

Notifies on the waitqueue.

— Function: CONDITION-WAIT WAITQUEUE MUTEX

Registers on the waitqueue, releases mutex, and waits for a notification on the waitqueue.

— Function: LIST-ALL-THREADS

Returns a list of all threads

— Function: MAKE-THREAD FUNC &KEY NAME INITIAL-BINDINGS

Execute func as a thread with name name within dynamic bindings given by initial-bindings.

— Function: MAKE-WAITQUEUE

Generates a waitqueue.

— Class: MUTEX-MIXIN

A mixin which adds a mutex to every instance of the class.

Direct slots:

— Macro: NAMED-PARCELL NAME INPUTS &BODY BODY

Generate a parcell depending on the given input parameters (which can be parcells again).

— Function: NOTIFY WAITQUEUE-OBJECT &OPTIONAL N

Notifies waitqueue-object.

— Macro: PARCELL INPUTS &BODY BODY

Generate an unnamed parcell.

— Class: PARQUEUE

A thread-safe queue waiting for input.

Superclasses: QUEUE WAITQUEUE-MIXIN

Direct slots:

— Function: THREAD-NAME THREAD

Returns the name of the current thread.

— Function: WAIT WAITQUEUE-OBJECT &KEY WHILE UNTIL PERFORM &ALLOW-OTHER-KEYS

Waits on waitqueue-object while while is satisfied or until until is satisfied. After this, if it is given, the function perform is called.

— Class: WAITQUEUE-MIXIN

Waitqueue mixin.

Superclasses: MUTEX-MIXIN

Direct slots:

— Macro: WITH-MUTUAL-EXCLUSION (OBJ) &BODY BODY

Execute body on the waitqueue obj without other threads interfering.

— Macro: WITH-WORKERS (WORK) &BODY BODY

This macro distributes work generated in body with calling the locally bound function work-on on some arguments to several working threads which call func on those arguments.