Next: , Previous: , Up: Reference manual   [Contents][Index]


7.9 Package FL.PARALLEL

This package provides some Femlisp extensions for parallel execution building on the BORDEAUX-THREADS and LPARALLEL libraries

Class: MUTEX-MIXIN

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

Direct slots:

Class: PARPOOL

A parallel pool implemented as a shared hash-table. The slot pool contains a hash-table, the test slot contains the hash-table test, the generator contains a function which is called if the pool is empty, i.e. all objects are used and generates a new object for the given argument.

Superclasses: MUTEX-MIXIN

Direct slots:

Class: PARQUEUE

A thread-safe queue waiting for input.

Superclasses: QUEUE WAITQUEUE-MIXIN

Direct slots:

Function: PWORK FUNCTION &OPTIONAL ARGUMENTS

Distribute a task to each lparallel worker and wait until all finish. Arguments may be a vector of size equal or smaller than (kernel-worker-count). All results are collected in a vector of the same size.

Function: REGISTER-IN-POOL POOL KEY OBJECT

Note that the object is only registered, but not put in the pool!

Class: WAITQUEUE-MIXIN

Waitqueue mixin.

Superclasses: MUTEX-MIXIN

Direct slots:

Macro: WITH-ACCUMULATORS (NAME INITIAL-ELEMENT REDUCE-OP) &BODY BODY

This macro sets up an array of accumulators for each worker initialized with initial-element. Within each worker the symbol name can be used for accessing the private accumulator. After the body was executed (probably containing parallel operations), the result array is reduced using reduce-op.

Macro: WITH-ATOMIC-OUTPUT &BODY BODY

If output of a process is desired to be atomic wrap it in with-atomic-output.

Macro: WITH-FEMLISP-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.

Macro: WITH-MUTEX OBJECT &BODY BODY

Needs to be called unfortunately around push/incf/setf.

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

Execute body on the waitqueue obj without other threads interfering.

Macro: WITH-WORKERS (WORK &REST KEYWORD-ARGS &KEY &ALLOW-OTHER-KEYS) &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.


Next: , Previous: , Up: Reference manual   [Contents][Index]