running pure functions in parallel

Simen kjaeraas simen.kjaras at gmail.com
Tue Aug 3 12:18:20 PDT 2010


Justin <justin at economicmodeling.com> wrote:

> I'm designing an application which needs to process a lot of data as  
> quickly as
> possible. I've found that I can engineer the processing algorithms into  
> pure
> functions which can operate on different segments of my data. I would  
> like to
> run these functions in parallel but:
>
> spawn() precludes returning a value
> the docs seem to be silent on the possibility of using out parameters
>
> Do I have to use messaging passing to get a value out of a pure function  
> being
> run in a separate thread?

Currently, the D standard library (phobos) does not support futures, but
David Simcha's parallelFuture does:
http://dsource.org/projects/scrapple/browser/trunk/parallelFuture

I would believe this is roughly what you're looking for.

-- 
Simen


More information about the Digitalmars-d-learn mailing list