Fix par-map&
To actually work in parallel.
This commit is contained in:
parent
46b4c87e92
commit
b8bd56a8f5
1 changed files with 12 additions and 10 deletions
|
|
@ -479,16 +479,18 @@ available. Return the resource once PROC has returned."
|
||||||
|
|
||||||
(define (par-mapper' mapper cons)
|
(define (par-mapper' mapper cons)
|
||||||
(lambda (proc . lists)
|
(lambda (proc . lists)
|
||||||
(let loop ((lists lists))
|
(apply
|
||||||
(match lists
|
fetch-result-of-defered-thunks
|
||||||
(((heads tails ...) ...)
|
(let loop ((lists lists))
|
||||||
(let ((tail (loop tails))
|
(match lists
|
||||||
(head (defer-to-parallel-fiber
|
(((heads tails ...) ...)
|
||||||
(lambda ()
|
(let ((tail (loop tails))
|
||||||
(apply proc heads)))))
|
(head (defer-to-parallel-fiber
|
||||||
(cons (fetch-result-of-defered-thunks head) tail)))
|
(lambda ()
|
||||||
(_
|
(apply proc heads)))))
|
||||||
'())))))
|
(cons head tail)))
|
||||||
|
(_
|
||||||
|
'()))))))
|
||||||
|
|
||||||
(define par-map& (par-mapper' map cons))
|
(define par-map& (par-mapper' map cons))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue