Assertion Error

Moritz Maxeiner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 13 15:27:30 UTC 2017


On Wednesday, 13 September 2017 at 15:12:57 UTC, Vino.B wrote:
> On Wednesday, 13 September 2017 at 11:03:38 UTC, Moritz 
> Maxeiner wrote:
>> On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote:
>>>
>>> Hi Max,
>>>
>>>  [...]
>>>
>>> Program Code:
>>> [...]
>>>  foreach (string Fs; parallel(SizeDirlst[0 .. $], 1))
>>>  {
>>> 			auto FFs = Fs.strip;
>>> 			auto MSizeDirList = task(&coSizeDirList, FFs, SizeDir);
>>> 			MSizeDirList.executeInNewThread();
>>> 			auto MSizeDirListData = MSizeDirList.workForce;
>>> 			MSresult.get ~= MSizeDirListData;
>>>  }
>>
>> [...]
>>
>> ---
>> foreach (string Fs; parallel(SizeDirlst[0 .. $], 1))
>> {
>>   MSresult.get ~= coSizeDirList(Fs.strip, SizeDir);
>> }
>> ---
>
> Hi Max,

It's Moritz, not Max. ;)

>
>  Below is the explanation of the above code.
>
> [...]

AFAICT that's a reason why you want parallelization of 
coSizeDirList, but not why you need to spawn another thread 
inside of an *already parallelelized" task. Try my shortened 
parallel foreach loop vs your longer one and monitor system load 
(threads, memory, etc).


More information about the Digitalmars-d-learn mailing list