Модифікація алгоритму пулу потоків з багатьма чергами
dc.citation.epage | 102 | |
dc.citation.issue | 1 | |
dc.citation.journalTitle | Комп'ютерні системи та мережі | |
dc.citation.spage | 96 | |
dc.citation.volume | 5 | |
dc.contributor.affiliation | Національний університет “Львівська політехніка” | |
dc.contributor.affiliation | Lviv Polytechnic National University | |
dc.contributor.author | Пуйда, Д. В. | |
dc.contributor.author | Puida, D. | |
dc.coverage.placename | Львів | |
dc.coverage.placename | Lviv | |
dc.date.accessioned | 2025-07-23T09:11:01Z | |
dc.date.created | 2023-02-28 | |
dc.date.issued | 2023-02-28 | |
dc.description.abstract | Наведено модифікацію алгоритму пулу потоків, який запропонував Шон Парент на конференції NDC London 2017. Запропонований алгоритм не поступається оригінальному алгоритму за швидкодією та простотою реалізації, і водночас усуває потенційний недолік оригінального алгоритму, який полягає у тому, що за певних обставин кілька задач можуть виконуватися на тому самому потоці, тоді як інші потоки – перебувати в стані очікування задачі. Основна ідея, яка запропонована в роботі, полягає у відстеженні сумарної кількості задач, які містяться в чергах пулу потоків. Коли головний потік поміщає нову задачу в якусь із черг, лічильник кількості задач збільшується на одиницю. Коли задача вилучається з черги, лічильник кількості задач зменшується на одиницю. У випадку, коли потік пулу хоче отримати задачу, він переглядає черги доти, доки йому не вдасться отримати задачу з якоїсь із черг або доки лічильник кількості задач не дорівнюватиме нулю. Якщо лічильник кількості задач дорівнює нулеві, потік переходить у стан сну до моменту, коли лічильник кількості потоків не стане знову ненульовим. Тоді один із потоків пулу прокидається і починає перевіряти черги на наявність задач. Дуже важливо зберегти рівномірний розподіл задач по чергах, оскільки це істотно впливає на швидкодію програми. | |
dc.description.abstract | In this paper, the author suggests a modification of the thread pool algorithm that was presented by Sean Parent at NDC London 2017. The suggested algorithm is as simple as the original implementation and demonstrates similar performance, while eliminating a potential drawback of the original implementation consisting in the fact that under certain circumstances, multiple tasks can be executed on the same thread, while other threads may be waiting for a task. The suggested idea consists in tracking the total number of tasks that are in the queues of the thread pool. When the main thread pushes a new task to one of the queues, the tasks counter is incremented. When a task is removed from the queue, the task counter is decremented. When a thread wants to get a task, it keeps checking the queues until it succeeds in getting a task from one of the queues, or until the tasks counter becomes equal to zero. When the tasks counter becomes equal to zero, the thread becomes idle until the counter becomes non-zero again. Then, one of the threads wakes up and starts checking the queues. An important point is to maintain even distribution of tasks in the queues since it has a significant impact on the performance of the algorithm. | |
dc.format.extent | 96-102 | |
dc.format.pages | 7 | |
dc.identifier.citation | Пуйда Д. В. Модифікація алгоритму пулу потоків з багатьма чергами / Д. В. Пуйда // Комп'ютерні системи та мережі. — Львів : Видавництво Львівської політехніки, 2023. — Том 5. — № 1. — С. 96–102. | |
dc.identifier.citationen | Puida D. Modification of a thread pool algorithm with multiple task queues / D. Puida // Computer Systems and Networks. — Lviv : Lviv Politechnic Publishing House, 2023. — Vol 5. — No 1. — P. 96–102. | |
dc.identifier.doi | doi.org/10.23939/csn2023.01.096 | |
dc.identifier.uri | https://ena.lpnu.ua/handle/ntb/111627 | |
dc.language.iso | uk | |
dc.publisher | Видавництво Львівської політехніки | |
dc.publisher | Lviv Politechnic Publishing House | |
dc.relation.ispartof | Комп'ютерні системи та мережі, 1 (5), 2023 | |
dc.relation.ispartof | Computer Systems and Networks, 1 (5), 2023 | |
dc.relation.references | 1. Amdahl G. The validity of the single processor approach to achieving large-scale computing capabilities, Proceedings of AFIPS Spring Joint Computer Conference, Atlantic City, N. J., AFIPS Press, 483-485. | |
dc.relation.references | 2. ISO International Standard ISO/IEC 14882:2020(E). Programming Language C++. | |
dc.relation.references | 3. David Chase and Yossi Lev, Dynamic circular work-stealing deque, SPAA, 21–28. ACM, 2005. DOI: 10.1145/1073970.1073974. | |
dc.relation.references | 4. K. Agrawal et al. Executing task graphs using work-stealing, IEEE IPDPS, April 2010, 1–12. DOI: 10.1109/IPDPS.2010.5470403. | |
dc.relation.references | 5. Nhat Minh Lé et al., Correct and efficient work-stealing for weak memory models, PPoPP, 69–80. ACM, 2013. DOI: 10.1145/2442516.2442524. | |
dc.relation.references | 6. T. Huang et al., Cpp-Taskflow: Fast task-based parallel programming using modern C++. In IEEE IPDPS, May 2019, 974–983. DOI: 10.1109/IPDPS.2019.00105. | |
dc.relation.references | 7. C.-X. Lin, T.-W. Huang and M. D. F. Wong, An Efficient Work-Stealing Scheduler for Task Dependency Graph, 2020 IEEE 26th International Conference on Parallel and Distributed Systems (ICPADS), Hong Kong, 2020, 64–71. DOI: 10.1109/ICPADS51040.2020.00018. | |
dc.relation.references | 8. Intel oneAPI Threading Building Blocks. URL: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html | |
dc.relation.references | 9. Sean Parent, Better Code: Concurrency, NDC { London } 2017. URL: https://seanparent.stlab.cc/presentations/2016-08-08-concurrency/2016-08-08-concurrency.pdf | |
dc.relation.references | 10. Thread Pool Benchmark. URL: https://github.com/Red-Portal/thread-pool-benchmark/ | |
dc.relation.referencesen | 1. Amdahl G. The validity of the single processor approach to achieving large-scale computing capabilities, Proceedings of AFIPS Spring Joint Computer Conference, Atlantic City, N. J., AFIPS Press, 483-485. | |
dc.relation.referencesen | 2. ISO International Standard ISO/IEC 14882:2020(E). Programming Language C++. | |
dc.relation.referencesen | 3. David Chase and Yossi Lev, Dynamic circular work-stealing deque, SPAA, 21–28. ACM, 2005. DOI: 10.1145/1073970.1073974. | |
dc.relation.referencesen | 4. K. Agrawal et al. Executing task graphs using work-stealing, IEEE IPDPS, April 2010, 1–12. DOI: 10.1109/IPDPS.2010.5470403. | |
dc.relation.referencesen | 5. Nhat Minh Lé et al., Correct and efficient work-stealing for weak memory models, PPoPP, 69–80. ACM, 2013. DOI: 10.1145/2442516.2442524. | |
dc.relation.referencesen | 6. T. Huang et al., Cpp-Taskflow: Fast task-based parallel programming using modern C++. In IEEE IPDPS, May 2019, 974–983. DOI: 10.1109/IPDPS.2019.00105. | |
dc.relation.referencesen | 7. C.-X. Lin, T.-W. Huang and M. D. F. Wong, An Efficient Work-Stealing Scheduler for Task Dependency Graph, 2020 IEEE 26th International Conference on Parallel and Distributed Systems (ICPADS), Hong Kong, 2020, 64–71. DOI: 10.1109/ICPADS51040.2020.00018. | |
dc.relation.referencesen | 8. Intel oneAPI Threading Building Blocks. URL: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html | |
dc.relation.referencesen | 9. Sean Parent, Better Code: Concurrency, NDC { London } 2017. URL: https://seanparent.stlab.cc/presentations/2016-08-08-concurrency/2016-08-08-concurrency.pdf | |
dc.relation.referencesen | 10. Thread Pool Benchmark. URL: https://github.com/Red-Portal/thread-pool-benchmark/ | |
dc.relation.uri | https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html | |
dc.relation.uri | https://seanparent.stlab.cc/presentations/2016-08-08-concurrency/2016-08-08-concurrency.pdf | |
dc.relation.uri | https://github.com/Red-Portal/thread-pool-benchmark/ | |
dc.rights.holder | © Національний університет “Львівська політехніка”, 2023 | |
dc.rights.holder | © Пуйда Д. В., 2023 | |
dc.subject | багатопотоковість | |
dc.subject | пул потоків | |
dc.subject | перехоплення задач | |
dc.subject | multithreading | |
dc.subject | thread pool | |
dc.subject | task stealing | |
dc.subject.udc | 004.825 | |
dc.title | Модифікація алгоритму пулу потоків з багатьма чергами | |
dc.title.alternative | Modification of a thread pool algorithm with multiple task queues | |
dc.type | Article |
Files
License bundle
1 - 1 of 1