parallel

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 5 12:45:25 PST 2015


On 11/05/2015 12:43 PM, Handyman wrote:
> On Thursday, 5 November 2015 at 20:40:00 UTC, anonymous wrote:
>> So one of your four cores has to make two dishes. That takes two seconds.
>
> So make fine-grained?
>
> foreach (i; 0..50)
>     Thread.sleep(20.msecs);
>
> But then my program still says: '2 secs'.   Please enlighten me.
>

That's still 1 second per task. The function prepare() cannot be 
executed by more than one core.

Ali



More information about the Digitalmars-d-learn mailing list