[Issue 19330] New: taskPool.workerIndex is wrong for single tread task pool

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 24 07:01:54 UTC 2018


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 at puremagic.com
          Reporter: ilyayaroshenko at 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

--


More information about the Digitalmars-d-bugs mailing list