TaskScheduler icon indicating copy to clipboard operation
TaskScheduler copied to clipboard

Test "YieldTasks" fails on CPUs with more than 8 physical threads

Open jkunstwald opened this issue 5 years ago • 1 comments

In SimpleTests.cpp, line 192, this vector is declared:

MT::StaticVector<YieldTask, 512> tasks;

which is then filled with taskCount elements. On CPUs with many threads, taskCount easily exceeds 512, it is 900 with 16 threads for example.

Subsequently if raising that limit to a "safe" maximum, like 2048, line 206 has to be adjusted as well to pass taskCount instead of tasks.Size() to RunAsync:

scheduler.RunAsync(MT::TaskGroup::Default(), tasks.Begin(), (uint32)taskCount);

Sadly the test fails on my CPU even after this fix at the check in line 163:

CHECK_EQUAL(TASK_COUNT_PER_WORKER, state1->counterPhase0);

Where TASK_COUNT_PER_WORKER is 60, but state1->counterPhase0 is 0.

System: Win10 1809 VS19 Toolset v142 Ryzen 2700X

jkunstwald avatar Jun 02 '19 19:06 jkunstwald

Thank you for this feedback. I'll take a look at this and I hope I'll make a fix soon.

SergeyMakeev avatar Jul 05 '19 22:07 SergeyMakeev