Parallel ranges, how?

Philippe Sigaud philippe.sigaud at gmail.com
Sun May 30 14:18:09 PDT 2010


On Sun, May 30, 2010 at 22:59, Simen kjaeraas <simen.kjaras at gmail.com>wrote:

> Simen kjaeraas <simen.kjaras at gmail.com> wrote:
>
>  How does the current range system accommodate parallel iteration?
>>
>> As far as I can see, a context switch could happen between calls to
>> popFront and front, thus popping a value off the range before we're
>> able to get its value.
>>
>
> Anyone? It seems to me the system is not thread-safe, and a parallel
> range should have the functions lock() and unlock(), so a foreach
> would work basically like this:
>

I don't know if that'd help you, but did you have a look at David Simcha's
parallelFuture module?

http://cis.jhu.edu/~dsimcha/parallelFuture.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100530/809d638c/attachment.html>


More information about the Digitalmars-d-learn mailing list