Just got a few minutes off and was thinking: maybe you are a less
experienced Schemer asking for a parallel map executed by subprocesses.

Am Mittwoch, den 29.12.2010, 11:56 +0100 schrieb Jörg F. Wittenberger:
> Maybe this is better for you?
> 
> Use like this:
> 
> (process-call (lambda () 7)) => 7

A parallel map could then look like:

(define (my-function a b) (+ a b))

(map thread-join!
     (map (lambda (parameters)
            (thread-start! (make-thread
                            (lambda ()
                              (process-call
                               (lambda ()
                                 (apply my-function parameters))))
                            'parallel)))
          '( (1 2) (3 4) (4 5))))

But Beware: my-function must not raise an exception and return ONLY
data, which is write/read idempotent (a restriction which probably
applies more or less to your Python example too).



_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to