Bill Clementson's Blog: Parallel Map Beer Song in Erlang
How does one do parmap, found in the following blog entry by Bill Clementson, in Termite? http://bc.tech.coop/blog/070601.html It appears a similar implementation would use list comprehensions; so a related question is whether anyone is interesting in snowing srfi-42: http://srfi.schemers.org/srfi-42/srfi-42.html Brad PS: I hereby claim the first use of "to show" as a transitive verb in English!
Afficher les réponses par date
-----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?
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-----
participants (2)
-
Bradley Lucier -
Marc Feeley