Motivated by "The load balancing issue in Poco::ActiveThreadPool" #4544#4548
Motivated by "The load balancing issue in Poco::ActiveThreadPool" #4544#4548bas524 wants to merge 3 commits intopocoproject:mainfrom
Conversation
…project#4544" Optimization allows redistribute tasks to the idle threads
|
Thanks for the contribution. IMO partial refactoring of ActiveThreadPool (and related classes) to have a single task queue in the pool where the threads take the work from would automatically create optimal load-balancing and simplify the implementation at the same time. |
Hi! |
|
This change appears to fail with the Thread Sanitizer. The actual log has much more in it https://github.com/pocoproject/poco/actions/runs/8982526627/job/24670333088?pr=4548. |
try increase a number of tasks and remove sleep from short-task for tests
@matejk |
Optimization allows redistribute tasks to the idle threads
When ActiveThread dequeue next Runnable, it checks is optimization is true and if yes it try to find idle thread and resend task
By default optimization is false