[gambit-list] Bill Clementson's Blog: Parallel Map Beer Song in Erlang
Marc Feeley
feeley at iro.umontreal.ca
Fri Jun 1 16:41:15 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1-Jun-07, at 3:57 PM, Bradley Lucier wrote:
> How does one do parmap, found in the following blog entry by Bill
> Clementson, in Termite?
>
> http://bc.tech.coop/blog/070601.html
Untested:
(define (pmap f lst)
(let ((parent (self)))
(map (lambda (pid)
(recv ((,pid reply) reply)))
(map (lambda (x)
(spawn (lambda () (! parent (list (self) (f x))))))
lst))))
Marc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFGYIRr//V9Zc2T/v4RAstuAJ9Xq5JKX8RFSlT4+Hbb2WhjS0e6UgCfVMHr
I2Qm6ijzk75l4lBJcepOYvM=
=5qDt
-----END PGP SIGNATURE-----
More information about the Gambit-list
mailing list