Bug 8582 – std.parallelism unittest failure on single processor
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2012-08-24T12:04:00Z
Last change time
2012-08-26T00:17:31Z
Assigned to
nobody
Creator
edmccard
Comments
Comment #0 by edmccard — 2012-08-24T12:04:37Z
On a single-processor machine, the unittest for std.parallelism fails with the message
Testing generated/linux/debug/64/unittest/std/parallelism
totalCPUs = 1
[email protected](4082): unittest failure
Comment #1 by edmccard — 2012-08-24T12:06:03Z
The problem seems to be deterministic; it happens every time (15 out of the last 15 tries) I try to run the phobos unittests, under various CPU loads.
Comment #2 by dsimcha — 2012-08-24T12:43:00Z
I'm pretty sure this is because on a single core machine the default number of threads in the TaskPool is zero. finish() waits for all tasks to be finished by calling Thread.join(). The worker threads are supposed to finish the tasks. If there are no worker threads there's nothing to wait on.
Instead, while the calling thread is waiting, it should pop tasks off the queue and execute them. Furthermore, put() should throw if new tasks are placed on the queue while it's in this state.
Will make a pull request soon.
Comment #3 by github-bugzilla — 2012-08-26T00:15:51Z