summaryrefslogtreecommitdiff
path: root/include/comphelper/threadpool.hxx
AgeCommit message (Collapse)Author
2017-03-21comphelper:: fix MSVC hang in ThreadPool::shutdown(), try #2Michael Stahl
This takes a different approach than commit 9899ffd244dd367ba69dffe1f21f4f0222064a46. Change the ThreadPool to automatically shutdown and join all threads whenever waitUntilDone() is called. Then start the threads again in pushTask(). Because the ThreadPool is meant to be used synchronously with waitUntilDone() called after adding all required tasks, this should obviate the need to call shutdown() before process exit, as there won't be any threads running at that point. Change-Id: I2b8e639004a94cf05ccb4522aa1f0d3dac88a936 Reviewed-on: https://gerrit.libreoffice.org/35510 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-12-23loplugin:unusedmethodsNoel Grandin
Change-Id: Ife4c8d948ffa116f044d43903de9485e43cfcae5 Reviewed-on: https://gerrit.libreoffice.org/32336 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-01tdf#104126 - comphelper thread-pool, use reliable std::condition_variable.Michael Meeks
The existing osl::Condition is an API and reliability disaster area. Change-Id: I3be84e1c6a83e58c43c40c9c8720790d923a6694 Reviewed-on: https://gerrit.libreoffice.org/31163 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-11-08loplugin:unnecessaryvirtual in comphelper..formsNoel Grandin
Change-Id: Iabe292e68cb84b97f207061347ed6a30309dc9fd Reviewed-on: https://gerrit.libreoffice.org/30679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-07-18add tagging to ThreadTasks so we don't need more one poolNoel Grandin
If more than one place in the code submits tasks to the shared pool, then waitTillDone() becomes unreliable. Add a tagging mechanism, so different callsites can wait on different sets of tasks. Also try to protect our worker threads against exceptions from the thread tasks code. Change-Id: Idde664ab50008d31a2dd73910bb22f50e62ae22f Reviewed-on: https://gerrit.libreoffice.org/27042 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-15tdf#98955 hardware_concurrency not ideal for thread poolsAshod Nakashian
A new static member getPreferredConcurrency added to comphelper::ThreadPool to return a configurable max number of threads. By default the new function returns the hardware_concurrency value provided by std::thread. When MAX_CONCURRENCY envar is defined, the return value is limited to whatever is set there. Three call-sites that used std::thread::hardware_concurrency have been replaced with getPreferredConcurrency. Unittests added to cover the functionality of the new member. Unittests are capped to 4 threads. Change-Id: I3332e393a88a5ed436316fa712ed920a4b37f4af Reviewed-on: https://gerrit.libreoffice.org/26254 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-07-02loplugin:unusedmethods comphelperNoel Grandin
Change-Id: I704a1e777505dbad83d81857f09601c2887fb6a1 Reviewed-on: https://gerrit.libreoffice.org/16682 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-03-12vcl: parallelize image scaling.Michael Meeks
(cherry picked from commit ffdf0ed4cd76188e780eceee4333f90a00217f9d) Change-Id: Ia452487c0c8c66a35c4b9fba225348bdef1a27f7
2015-02-16boost->stdCaolán McNamara
Change-Id: I44b208a2c5c5bf73ac025462c9f7bd499ed0a49b
2014-11-04Make comphelper::ThreadPool explicitly noncopyableMatúš Kukan
Change-Id: Ie57d0194418dd17a4c83e2859d6a85129c4f95e6
2014-10-31thread-pool: fix waiting until all tasks are complete.Michael Meeks
Change-Id: Iaf5a3bf28879f229a223a8760fd878f96958a53c
2014-10-30thread-pool: re-work termination semantics to avoid problems.Michael Meeks
We want a pre-spun-up, shared thread-pool that doesn't get its workers created & joined frequently. Change-Id: I29081e3a3e3849ca30e63fd080ee3315d99cbe8d
2014-10-30Move thread-pool down into comphelper for re-use elsewhere.Michael Meeks
Change-Id: Ib27b8b1ccc07ff194035d6c2ef3d45c429e3cea1