summaryrefslogtreecommitdiffstats
path: root/src/core/jobs/qthreadpooler_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QThreadPooler: remove maxThreadCount prototypePaul Lemire2022-07-181-2/+0
| | | | | | | | Since implementation was removed in Qt 6. Pick-to: 6.4 6.3 6.2 Change-Id: Ia2ca6a88bdb7d4fd02801ce8fac99cda3f39d102 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use SPDX license identifiersLucie Gérard2022-06-221-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I8105424281eed871037fa6c463871ca8829876b5 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-091-2/+2
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Centralize the maxThreadCount informationPaul Lemire2020-05-071-1/+1
| | | | | | | | | | | Add a static function on QThreadPooler which returns the ideal thread count (capped by QT3D_MAX_THREAD_COUNT) if set. Call that function from all places that need that information. Avoids code duplication and potentially reading the env value every frame. Change-Id: I699691af33ed0a65aa557ed48aabb9de8929dcc2 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix memory leaksMike Krus2020-03-041-0/+1
| | | | | | | | | | | Some jobs get skipped because they don't have anything to do. However, since the runnable does not get submitted to the pool, it would leak (along with the job it points to). Also fixed a couple of compile warnings. Change-Id: I7a25649f2f760c0593862328c0ab905da98c982a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add flag to jobs to indicate if they need to run or notMike Krus2020-02-141-1/+4
| | | | | | | | | | | | | | | | | | | Once aspect jobs are inserted in the queue, they will always run, but some of them don't actually have anything to do at every frame. Ideally, when building a graph of jobs, you would include only jobs that are required. However this makes building the graph more complicated. This introduces a method on the private job pimple which indicated if the job actually has something to do or not. When the scheduler is ready to run a job, it will call that method. If there's nothing to do, then the job will be skipped and the dependent jobs (if any) run instead. Change-Id: Iaa8d3d064f03d8c0bab407879a9acea292a06784 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make tracing a runtime optionMike Krus2019-12-131-15/+0
| | | | | | | | | | | - Moved most of the code QSystemInformationService (private class for now) - Tracing can be enabled by setting QT3D_TRACE_ENABLED or calling QSystemInformationService::setTraceEnabled(bool) - Introduced QTaskLogger class to easy logging (RAII) Change-Id: I2a3e08e4371fcee3e9ef3cf575725f13f57d1a94 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make QThreadPooler use the global thread poolPaul Lemire2019-12-021-1/+1
| | | | | | | This should ensure we don't have too many idling threads Change-Id: Ia533fc07140a4944a1149aca1565b0d8ae3cda22 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Switch export macros to standard formKai Koehne2019-04-021-1/+1
| | | | | | | | | | | | Qt expects the export macros to have Q_ prefixes, otherwise the symbol versioning script won't find them and mark them. Also remove non-exising QT3DLOGIC_PRIVATE_EXPORT macro from src/doc/qt3d.qdocconf Task-number: QTBUG-74752 Change-Id: I71b9e85ff09c002fb283824aa51a5a8f50e937f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2017-09-121-4/+0
|\ | | | | | | Change-Id: Id6a3d4ec579a2f2a2e559c22a2293d0e184f0bdf
| * Improve dependency look-upChristian Strømme2017-09-061-4/+0
| | | | | | | | | | | | | | | | | | Simplify the dependency look-up by moving the dependers directly into the dependee runnable, each task is then responsible for updating their dependers and queue them up when they are free to be run. Change-Id: I96295d47cecd507a864965e1fb65f2ff9af68111 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Properly use QT_CONFIG for Qt3D profiling optionsPaul Lemire2017-08-031-2/+2
|/ | | | | | Change-Id: Id3bb7bb657f3d48c6c4cd3d5e86c43ad64dca791 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fixes includes to comply with coding conventions for Src/CoreRobert Brock2017-03-311-7/+8
| | | | | | | | Reordering the header includes to comply with Qt coding conventions Task-number: QTBUG-56185 Change-Id: I3943678c183c4ef46d403e0fff878c3cad964dfa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Job Traces: add support for Submission framesPaul Lemire2016-07-171-1/+5
| | | | | | | | | We now have worker frames for jobs and submission frames for render command submissions. Since both can happen concurrently, slightly adjusted what needed to be. Change-Id: I355bb6540090b4f569d38f4989dc9911dc381974 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QThreadPooler: aggregate mutex by valueMarc Mutz2016-04-301-1/+1
| | | | | | | | There's no reason to incur a heap allocation for something as simple as a mutex. Change-Id: I9489b2348c142e028009b757d8f922fea43e168b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add more job run statsPaul Lemire2016-03-211-1/+1
| | | | | | | | - store submission time - store instance of the renderview Change-Id: Ifccb63b9adc93fa16c9e950b4c0300d8b3414b88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Qt3D job run statsPaul Lemire2016-03-041-1/+12
| | | | | | | | | | | Add a way to write to a trace.qt3d file stats about the frame jobs Then use the qt3dprofiler tool to visualize the trace file This is enabled by defining QT3D_JOBS_RUN_STATS at compile time Change-Id: I4d2faaf5189cd91ecc88b7ca0ca3e3e1f2f60498 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unify license header usageAntti Kokko2016-01-261-12/+15
| | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I8eac0cd6bbc276a56df487249cc459c0d4fab165 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* QThreadPooler: few improvementsPaul Lemire2015-12-061-2/+2
| | | | | | Change-Id: Ib312bacc9703bfde65d2d95e953f57e55635aebc Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Mika Salmela <mika.salmela@theqtcompany.com>
* QThreadPooler: use a private ThreadPoolPaul Lemire2015-10-241-0/+2
| | | | | | | | as anyone could modify the expiry timeout on the global instance of the QThreadPool Change-Id: I5114273f799b95f8237f580d8e18133769052ff6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-5/+5
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add "We mean it" warnings to private headersSean Harmer2015-10-131-0/+11
| | | | | Change-Id: Ic4a69123255c33990765ea3601e01914c2d8cb70 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Expose the max thread count from the poolerLaszlo Agocs2015-07-311-0/+2
| | | | | | | | | | | | Assuming that the pooler allows up to idealThreadCount() threads is only true when the default settings of QThreadPool are in use. Once the limit gets reduced via setMaxThreadCount(), we get a deadlock. So expose the max number of threads (like with ThreadWeaver) from QThreadPooler and use that value instaed. Change-Id: I1ec0789da5f52a5b333b24f4b3b37dd487c69841 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add checks for double task executionMika Salmela2015-04-271-1/+1
| | | | | | | | | | On ThreadPooler done tasks are also removed from the dependency pair list. Also added reserved flag for tasks. These prevent tasks getting into execution more than once. Change-Id: Ia9e5377c883ad08079a9af32c4a2a294db425eb2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Implement ThreadPooler using QThreadPoolMika Salmela2015-04-241-17/+14
| | | | | | | Re-implemented ThreadPooler to use QRunnable and QThreadPool. Change-Id: I3da0182489b648dcb6b671c57b4474c183bddeec Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* ThreadPooler to replace ThreadWeaverMika Salmela2015-02-191-0/+86
Initial version of ThreadPooler to substitute 3rd party ThreadWeaver. Qt3D will be released under LGPLv3 and commercial licensing terms, therefore we can't share code with free licenses. Change-Id: Ic0956b40e4960002205ee32c19a053813339791c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>