Handbook
Glossary
parallel-each ( seq quot: ( elt -- ) -- )
Concurrent combinators
Next:
2parallel-each ( seq1 seq2 quot: ( elt1 elt2 -- ) -- )
Vocabulary
concurrency.combinators
Inputs
seq
a
sequence
quot
a
quotation
with stack effect
( elt -- )
Outputs
None
Word description
Spawns a new thread for applying
quot
to every element of
seq
, blocking until all quotations complete.
Errors
Throws an error if one of the iterations throws an error.
Definition
USING:
concurrency.combinators.private
concurrency.count-downs
kernel
sequences
;
IN:
concurrency.combinators
:
parallel-each
( seq quot: ( elt -- ) -- )
over
length
[
[
[
curry
]
curry
]
dip
[
spawn-stage
]
curry
compose
each
]
(parallel-each)
;
inline