|(require rparallel)||package: rparallel|
This package provides high-level parallel forms.
The implementation relies on Racket futures. Due to coordination overhead the library is only useful to parallelize computationally instensive code. For instance, consider the following:
Here the parallel form creates several futures whose overhead vastly prevails over the relatively cheap sqrt operation. This leads to a much slower computation than the respective serial map call. To take advantage from multiple processor, larger chunks of computation needs to be distributed over fewer futures, for instance:
(parallel-let ((x (map sqrt (range 1000))) (y (map sqrt (range 1000) (range 1000000)))) (append x y))
See Parallelism with Futures for further subtleties related to the use of futures with the regular Racket BC (before Chez Scheme) variant.
(parallel-values v ...)
(parallel-let ([id val-expr] ...) body ...+)
See pmap : Parallel map for alternative parallel map procedures that leverage both Racket futures and places forms of parallelism.