RosettaCodeData/Task/Concurrent-computing/Scheme/concurrent-computing-2.scm
2024-10-16 18:07:41 -07:00

5 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)))