Issue 19330 - taskPool.workerIndex is wrong for single tread task pool
Summary: taskPool.workerIndex is wrong for single tread task pool
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-24 07:01 UTC by Илья Ярошенко
Modified: 2024-12-01 16:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Илья Ярошенко 2018-10-24 07:01:54 UTC
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
Comment 1 berni44 2020-01-03 15:33:01 UTC
Can't see why this should be a blocker, nor why it is trivial.
Comment 2 dlangBugzillaToGithub 2024-12-01 16:34:21 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10354

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB