You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once a pool is paused and a task received, the worker wait is skipped it repeats the loop until unpaused. This makes workers enter a busy loop with max CPU usage.
Did not find a way to test for this in the testing code.
Fix:
Change the worker wait condition to task_available_cv.wait(tasks_lock, [this] { return (!tasks.empty() && !paused) || !workers_running; });
Add task_available_cv.notify_all(); in unpause()
The text was updated successfully, but these errors were encountered:
Thanks for the bug report! This somehow slipped through the cracks. I don't think there's any way to automate this test, since the C++ standard library does not allow you to check CPU utilization of a thread, but I did a quick test and I can confirm that this bug exists and that your fix resolves it.
The fix will be implemented in release v3.6.0, which should hopefully be available within a few weeks (even sooner if I can find the time). Thanks again :)
Once a pool is paused and a task received, the worker wait is skipped it repeats the loop until unpaused. This makes workers enter a busy loop with max CPU usage.
Did not find a way to test for this in the testing code.
Fix:
task_available_cv.wait(tasks_lock, [this] { return (!tasks.empty() && !paused) || !workers_running; });
task_available_cv.notify_all();
inunpause()
The text was updated successfully, but these errors were encountered: