On a single-processor machine, the unittest for std.parallelism fails with the message Testing generated/linux/debug/64/unittest/std/parallelism totalCPUs = 1 core.exception.AssertError@std.parallelism(4082): unittest failure
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.
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.
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/ab9691df2e74d042dd6e7ba78fbca0edb479f494 Fix Bug 8582. https://github.com/D-Programming-Language/phobos/commit/15adb861b09e1f2455f9a2685319a890671e3c32 Merge pull request #757 from dsimcha/master Fix Bug 8582