Emaphores and mutexes – comparison in terms of time required to complete the sample task
DOI:
https://doi.org/10.34767/SIMIS.2025.03.03Keywords:
Parallel programming, C++, semaphore, mutex, critical region, program runtimeAbstract
Within the parallel programming paradigm, several data-flow synchronization methods have been developed to protect a program's critical section from race conditions that cause erroneous or unpredictable execution. This article will compare semaphores and mutexes in terms of the time required to complete a sample task. Although general (counting) semaphores can share the critical section with multiple threads simultaneously, binary semaphores and mutexes perform significantly faster.
References
Chen G., Stenstrom P., “Critical lock analysis: Diagnosing critical section bottlenecks in multithreaded applications”, SC '12: Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, Salt Lake City, UT, USA, 2012, pp. 1-11, DOI: 10.1109/SC.2012.40.
Matuszek M., „Zjawisko wyścigu w programowaniu współbieżnym." Wydawnictwo Politechniki Gdańskiej, 2021, str. 261-270.
Silberschatz A., Galvin P. B., Gagne G. “Operating system concepts essentials”, Wiley Publishing, 2013.
Czech Z., „Wprowadzenie do obliczeń równoległych”, Wyd. 2. Warszawa: Wydawnictwo Naukowe PWN, 2013. ISBN 987-83-01-17290-9.
Williams A., “C++ concurrency in action”, Wyd. Simon and Schuster, 2019.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.