RosettaCodeData/Task/Concurrent-computing/Scheme/concurrent-computing-2.scm

6 lines
169 B
Scheme

(import (srfi 18))
(define (parallel-execute . thunks)
(let ((threads (map make-thread thunks)))
(for-each thread-start! threads)
(for-each thread-join! threads)))