www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19330] New: taskPool.workerIndex is wrong for single tread

https://issues.dlang.org/show_bug.cgi?id=19330

          Issue ID: 19330
           Summary: taskPool.workerIndex is wrong for single tread task
                    pool
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

import std.parallelism, std.stdio, std.range;

void main()
{
    defaultPoolThreads = 1;
        foreach(i; taskPool.parallel(8.iota))
                taskPool.workerIndex.writeln;
}

=====
current output:
0
0
0
0
0
0
0
0
=====
expected output according to the documentation:
1
1
1
1
1
1
1
1

--
Oct 24 2018