[racket] Creating collections using Futures

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 19 19:50:59 EDT 2011

Allocation doesn't work very well in parallel. It is one of the few
operations that doesn't work well in parallel and yet will still
support a little because it is so hard to eliminate completely. But
when the two futures are doing essentially only allocation, then you
will see no parallel speedup.

If this is the essence of some larger program where the allocation
doesn't actually need to be shared, you might try places.


On Mon, Jul 18, 2011 at 10:04 AM, Stees, Micheal T.
<MSTEES at monmouthcollege.edu> wrote:
> I am trying to create a matrix like structure in parallel.  It was my intention to create each row of the matrix in parallel, and then simply combine them together using a list or some other collection.  My questions is this, the following code will create the structure that I am looking for, but it will not execute the creation of the two lists in parallel, am I doing something wrong here?
> (define (buildRow row)
> (build-list row (lambda (x) (random 10000000))))
> (let ([f (future (lambda () (buildRow 5000)))])
>  (list (buildRow 5000)
>      (touch f)))
> -Mike
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.