Emaphores and mutexes – comparison in terms of time required to complete the sample task

Authors

  • Julia Cieślicka Kazimierz Wielki University in Bydgoszcz
  • Aleksandra Mreła Kazimierz Wielki University in Bydgoszcz

DOI:

https://doi.org/10.34767/SIMIS.2025.03.03

Keywords:

Parallel programming, C++, semaphore, mutex, critical region, program runtime

Abstract

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

2025-12-22

How to Cite

Emaphores and mutexes – comparison in terms of time required to complete the sample task. (2025). Studies and Materials in Applied Computer Science, 17(3), 17-20. https://doi.org/10.34767/SIMIS.2025.03.03