Організація багатопотокових обчислень в С++

dc.citation.epage27
dc.citation.issue1
dc.citation.journalTitleКомп’ютерні системи проектування. Теорія і практика.
dc.citation.spage19
dc.citation.volume5
dc.contributor.affiliationНаціональний університет “Львівська політехніка”
dc.contributor.affiliationLviv Polytechnic National University
dc.contributor.authorАндрушко, Андрій
dc.contributor.authorМаркелов, Олександр
dc.contributor.authorAndrushko, Andriy
dc.contributor.authorMarkelov, Oleksandr
dc.coverage.placenameЛьвів
dc.coverage.placenameLviv
dc.date.accessioned2025-07-23T06:35:28Z
dc.date.created2023-02-28
dc.date.issued2023-02-28
dc.description.abstractВпродовж багатьох років, збільшення обчислювальної потужності сучасних пристроїв досягається не через підвищення тактової частоти та пропускної здатності процесорів, а шляхом застосування гіперпотокових і багатоядерних архітектур. Ця проста зміна підходу до дизайну комплектуючих призвела до драматичних змін в організації обчислень і стала поворотним пунктом для розробників програмного забезпечення. Програмне забезпечення, яке має скористатися збільшенням обчислювальної потужності багатоядерних архітектур, повинно бути розроблена таким чином, щоб мати змогу одночасно виконувати кілька завдань. При висвітленні теми паралельних/одночасних обчислень науковці та фахівці в галузі ІТ користуються двома термінами: (1) «паралелізм» (англ. parallelism) та (2) «одночасне/узгоджене виконання» (англ. сoncurrency). Третім важливим терміном при розгляді паралельних/одночасних обчислень, є «багатопотоковість» (multithreading). У C++ двома найпоширенішими способами реалізації паралелізму є узгоджене виконання та власне паралелізм. Хоча їх можна використовувати і в інших мовах програмування, C++ виділяється своїми можливостями використання одночасних обчислень з нижчим, ніж середнє, залученням загальних ресурсів машини, а також здатністю виконувати складні інструкції. У стандарті C++11 була запропонована підтримка багатопотокових програм. Стандарт C++ визнавав існування багатопотоковості у мові та надавав компоненти для написання багатопотокових програм у бібліотеці . Це зробило можливим написання багатопотокових програм на C++, не покладаючись на специфічні для певної платформи розширення, та дало змогу створювати портативний багатопотоковий код із гарантованою поведінкою. Бібліотека надає широкі можливості для організації паралельних та узгоджених/одночасних обчислень, містить також модель пам’яті C++, умовні змінні, м’ютекси та ін. для синхронізації роботи потоків. У статті здійснено аналіз можливостей написання програм мовою C++ з використанням кількох потоків для паралельного та/або узгодженого виконання завдань, а також розгляд функцій мови C++ і засобів бібліотеки , які роблять це можливим.
dc.description.abstractFor many years, the increase in computing power of modern devices is achieved not by increasing the clock frequency and bandwidth of CPUs, but by using hyper-threaded and multicore architectures. This simple change in approach to the CPU design led to dramatic changes in the organization of computing and became a turning point for software developers. Software that is going to take advantage of the increased computing power of multi-core architectures must be designed to be able to perform multiple tasks simultaneously. When covering the topic of parallel/simultaneous computing, scientists and IT professionals use two terms: (1) parallelism and (2) concurrency. A third important term when considering parallel/simultaneous computing is “multithreading”. In C++, the two most common ways to implement parallelism are concurrency and parallelism itself. Although they can be used in other programming languages, C++ stands out for its ability to use concurrent computations with lower-than-average utilization of general machine resources, as well as its ability to execute complex instructions. The C++11 standard introduced support for multi-threaded programs. The C++ standard recognized the existence of multithreading in the language and provided components for writing multithreaded programs in the library. This made it possible to write multithreaded programs in C++ without relying on platform-specific extensions and enabled the creation of portable multithreaded code with guaranteed behavior. The library provides extensive opportunities for organizing parallel and concurrent calculations, it also contains the C++ memory model, conditional variables, mutexes, etc. for thread synchronization. The article analyzes the possibilities of writing programs in the C++ using multiple threads for parallel and concurrent execution of tasks. It also considers the features of the C++ and the tools of the library that make parallelism and concurrency possible.
dc.format.extent19-27
dc.format.pages9
dc.identifier.citationАндрушко А. Організація багатопотокових обчислень в С++ / Андрій Андрушко, Олександр Маркелов // Комп’ютерні системи проектування. Теорія і практика. — Львів : Видавництво Львівської політехніки, 2023. — Том 5. — № 1. — С. 19–27.
dc.identifier.citationenAndrushko A. Creating multithreaded ptograms in C++ / Andriy Andrushko, Oleksandr Markelov // Computer Design Systems. Theory and Practice. — Lviv : Lviv Politechnic Publishing House, 2023. — Vol 5. — No 1. — P. 19–27.
dc.identifier.doidoi.org/10.23939/cds2023.01.019
dc.identifier.urihttps://ena.lpnu.ua/handle/ntb/111491
dc.language.isouk
dc.publisherВидавництво Львівської політехніки
dc.publisherLviv Politechnic Publishing House
dc.relation.ispartofКомп’ютерні системи проектування. Теорія і практика., 1 (5), 2023
dc.relation.ispartofComputer Design Systems. Theory and Practice, 1 (5), 2023
dc.relation.references1. Sutter H. (2009). The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software. Retrieved from: www.gotw.ca/publications/concurrency-ddj.htm
dc.relation.references2. Acar U. A., Chargueraud A., Rainey M. (2016). An Introduction to Parallel Computing in C++. Retrieved from: www.cs.cmu.edu/afs/cs/academic/class/15210-f18/www/pasl.html
dc.relation.references3. Wataru E., Shigeyuki S., Kenjiro T. (2022). ComposableThreads: Rethinking User-level Threads with Composability and Parametricity in C++, Journal of Information Processing, Vol.30, 269–282. https://doi.org/10.2197/ipsjjip.30.269
dc.relation.references4. Qiu W., Zhang Y., Wang L. (2019). Visual C + + and MFC Application in Safety Monitoring System of Airplane Depot, Advances in Computer Science Research, volume 88, 40-45, CNCI 2019, Atlantis Press. https://doi.org/10.2991/cnci-19.2019.6
dc.relation.references5. Thelin R. (2020). A tutorial on modern multithreading and concurrency in C++. Retrieved from: www.educative.io/blog/modern-multithreading-and-concurrency-in-cpp
dc.relation.references6. Сіциліцин Ю. О. (2022). Моделювання змісту дисципліни «Паралельні та розподілені обчислення», Педагогічні науки: теорія та практика, № 4 (44), 23-28. https://doi.org/10.26661/2786-5622-2022-4-03
dc.relation.references7. Wilson C. (2019). Multithreading and concurrency fundamentals. Retrieved from: www.educative.io/blog/multithreading-and-concurrency-fundamentals
dc.relation.references8. Williams A. (2019). C++ Concurrency in Action, Second Edition. Manning Publications Co. Shelter Island, NY.
dc.relation.references9. The Difference Between Asynchronous and Multi-Threading (2023). Retrieved from: www.baeldung.com/cs/async-vs-multi-threading
dc.relation.references10. MemarianK.,Matthiesen J., Lingard J.,Nienhuis K., Chisnall D., Watson R.N.M., Sewell P. (2016). Into the depths of C: elaborating the de facto standards, PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, 1–15.https://doi.org/10.1145/2908080.2908081
dc.relation.references11. Mahapatra S. (2023). Multithreading in C++. Retrieved from: www.geeksforgeeks.org/multithreading-in-cpp
dc.relation.references12. Ajkunic E., Fatkic H., Omerovic E., Talic K., Nosovic N. (2012). A Comparison of Five Parallel Programming Models for C++, 2012 Proceedings of the 35th International Convention, MIPRO 2012, Opatija, Croatia, May 21-25, 2012. IEEE 2012, 1780-1784.
dc.relation.referencesen1. Sutter H. (2009). The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software. Retrieved from: www.gotw.ca/publications/concurrency-ddj.htm
dc.relation.referencesen2. Acar U. A., Chargueraud A., Rainey M. (2016). An Introduction to Parallel Computing in C++. Retrieved from: www.cs.cmu.edu/afs/cs/academic/class/15210-f18/www/pasl.html
dc.relation.referencesen3. Wataru E., Shigeyuki S., Kenjiro T. (2022). ComposableThreads: Rethinking User-level Threads with Composability and Parametricity in C++, Journal of Information Processing, Vol.30, 269–282. https://doi.org/10.2197/ipsjjip.30.269
dc.relation.referencesen4. Qiu W., Zhang Y., Wang L. (2019). Visual C + + and MFC Application in Safety Monitoring System of Airplane Depot, Advances in Computer Science Research, volume 88, 40-45, CNCI 2019, Atlantis Press. https://doi.org/10.2991/cnci-19.2019.6
dc.relation.referencesen5. Thelin R. (2020). A tutorial on modern multithreading and concurrency in C++. Retrieved from: www.educative.io/blog/modern-multithreading-and-concurrency-in-cpp
dc.relation.referencesen6. Sitsylitsyn Yu. O. (2022). Modeliuvannia zmistu dystsypliny "Paralelni ta rozpodileni obchyslennia", Pedahohichni nauky: teoriia ta praktyka, No 4 (44), 23-28. https://doi.org/10.26661/2786-5622-2022-4-03
dc.relation.referencesen7. Wilson C. (2019). Multithreading and concurrency fundamentals. Retrieved from: www.educative.io/blog/multithreading-and-concurrency-fundamentals
dc.relation.referencesen8. Williams A. (2019). C++ Concurrency in Action, Second Edition. Manning Publications Co. Shelter Island, NY.
dc.relation.referencesen9. The Difference Between Asynchronous and Multi-Threading (2023). Retrieved from: www.baeldung.com/cs/async-vs-multi-threading
dc.relation.referencesen10. MemarianK.,Matthiesen J., Lingard J.,Nienhuis K., Chisnall D., Watson R.N.M., Sewell P. (2016). Into the depths of C: elaborating the de facto standards, PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, 1–15.https://doi.org/10.1145/2908080.2908081
dc.relation.referencesen11. Mahapatra S. (2023). Multithreading in C++. Retrieved from: www.geeksforgeeks.org/multithreading-in-cpp
dc.relation.referencesen12. Ajkunic E., Fatkic H., Omerovic E., Talic K., Nosovic N. (2012). A Comparison of Five Parallel Programming Models for C++, 2012 Proceedings of the 35th International Convention, MIPRO 2012, Opatija, Croatia, May 21-25, 2012. IEEE 2012, 1780-1784.
dc.relation.urihttps://doi.org/10.2197/ipsjjip.30.269
dc.relation.urihttps://doi.org/10.2991/cnci-19.2019.6
dc.relation.urihttps://doi.org/10.26661/2786-5622-2022-4-03
dc.relation.urihttps://doi.org/10.1145/2908080.2908081
dc.rights.holder© Національний університет “Львівська політехніка”, 2023
dc.rights.holder© Андрушко А., Маркелов О., 2023
dc.subjectС++
dc.subjectбагатопотоковість
dc.subjectпаралелізм
dc.subjectодночасне/узгоджене виконання
dc.subjectсинхронізація потоків
dc.subjectC++
dc.subjectmultithreading
dc.subjectparallelism
dc.subjectconcurrency
dc.subjectthread synchronization
dc.titleОрганізація багатопотокових обчислень в С++
dc.title.alternativeCreating multithreaded ptograms in C++
dc.typeArticle

Files

Original bundle

Now showing 1 - 2 of 2
Loading...
Thumbnail Image
Name:
2023v5n1_Andrushko_A-Creating_multithreaded_19-27.pdf
Size:
6.17 MB
Format:
Adobe Portable Document Format
Loading...
Thumbnail Image
Name:
2023v5n1_Andrushko_A-Creating_multithreaded_19-27__COVER.png
Size:
449.14 KB
Format:
Portable Network Graphics

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
1.83 KB
Format:
Plain Text
Description: