Development of lock-free approach for shared memory organisation in real-time multi-threading applications

Authors

DOI:

https://doi.org/10.15587/2706-5448.2024.309344

Keywords:

multi-threading, dynamic memory allocation, real-time systems, lock-free algorithms, game engine, high-performance computing

Abstract

The development vector of modern central processing units, which increasingly involves using a more significant number of cores and prioritizing parallelism over the high power of a single computational unit, presents new challenges for the existing software design. This work investigates and addresses the problem of access to shared memory in multithreaded environments, such as operating systems, interactive distributed computing systems, and high-performance simulation systems. Thus, the object of study is a non-blocking approach to organizing access to memory and performing basic operations with it through non-blocking synchronization.

The research methods include developing an approach to organizing access to shared memory using the double-word compare-and-swap algorithm, followed by a theoretical and practical comparison of the resulting outcome with the standard blocking access algorithm to shared memory for different configurations of the number of threads and the number of simultaneous memory access attempts. Additionally, testing was conducted within the framework of an unnamed closed-source project by integrating the solution into it, followed by A/B testing.

The results showed that using non-blocking approaches is advisable, especially in comparison with locking approaches, which demonstrated a performance degradation relative to the standard allocation algorithm by more than 300 %, while non-blocking approaches provided an improvement of 40–90 %. It was also found that using hybrid approaches to the organization of shared memory systems at the software level can lead to more stable results and mitigate application performance degradation compared to classical approaches such as buddy algorithms or free lists.

Despite the results obtained, the author remains cautious about the idea of memory management and pool organization at the software level and does not recommend using specialized allocation algorithms without an urgent need to speed up memory allocation itself. The purpose of these structures is still not to improve software performance directly but to enhance and speed up access to the data stored in them.

Author Biography

Oleksandr Syrotiuk, National Technical University of Ukraine «Igor Sikorsky Kyiv Polytechnic Institute»

PhD Student

Department of System Design

References

  1. Ross, P. E. (2008). Why CPU Frequency Stalled. IEEE Spectrum, 45 (4), 72–72. https://doi.org/10.1109/mspec.2008.4476447
  2. Efnusheva, D., Cholakoska, A., Tentov, A. (2017). A Survey of Different Approaches for Overcoming the Processor – Memory Bottleneck. International Journal of Computer Science and Information Technology, 9 (2), 151–163. https://doi.org/10.5121/ijcsit.2017.9214
  3. Barnes, N., Brooksby, R. (2002). Thirty person-years of memory management development goes Open Source. Available at: https://www.ravenbrook.com/project/mps/doc/2002-01-30/ismm2002-paper/ismm2002.html
  4. Ferreira, T. B., Matias, R., Macedo, A., Araujo, L. B. (2011). An Experimental Study on Memory Allocators in Multicore and Multithreaded Applications. 2011 12th International Conference on Parallel and Distributed Computing, Applications and Technologies. https://doi.org/10.1109/pdcat.2011.18
  5. Carribault, P., Pérache, M., Jourdren, H. (2011). Thread-Local Storage Extension to Support Thread-Based MPI/OpenMP Applications. Lecture Notes in Computer Science. Springer, 80–93. https://doi.org/10.1007/978-3-642-21487-5_7
  6. Von Puttkamer, E. (1975). A Simple Hardware Buddy System Memory Allocator. IEEE Transactions on Computers, C–24 (10), 953–957. https://doi.org/10.1109/t-c.1975.224100
  7. Larson, P.-Å., Krishnan, M. (1998). Memory allocation for long-running server applications. Proceedings of the 1st International Symposium on Memory Management. https://doi.org/10.1145/286860.286880
  8. Marotta, R., Ianni, M., Scarselli, A., Pellegrini, A., Quaglia, F. (2018). A Non-blocking Buddy System for Scalable Memory Allocation on Multi-core Machines. 2018 IEEE International Conference on Cluster Computing (CLUSTER). https://doi.org/10.1109/cluster.2018.00034
  9. Devkota, P. P. (2023). Dynamic Memory Allocation: Implementation and Misuse. https://doi.org/10.13140/RG.2.2.34993.97129
  10. Xu, J., Dou, Y., Song, J., Zhang, Y., Xia, F. (2008). Design and Synthesis of a High-Speed Hardware Linked-List for Digital Image Processing. 2008 Congress on Image and Signal Processing. https://doi.org/10.1109/cisp.2008.338
  11. Braginsky, A., Petrank, E. (2011). Locality-Conscious Lock-Free Linked Lists. Lecture Notes in Computer Science. Springer, 107–118. https://doi.org/10.1007/978-3-642-17679-1_10
  12. Senhadji-Navarro, R., Garcia-Vargas, I. (2018). High-Performance Architecture for Binary-Tree-Based Finite State Machines. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 37 (4), 796–805. https://doi.org/10.1109/tcad.2017.2731678
  13. Klein, N., Harel, E., Levi, I. (2021). The Cost of a True Random Bit – On the Electronic Cost Gain of ASIC Time-Domain-Based TRNGs. Cryptography, 5 (3), 25. https://doi.org/10.3390/cryptography5030025
  14. Beznosyk, O., Syrotiuk, O. (2023). Usage of a computer cluster for physics simulations using bullet engine and OpenCL. Technology Audit and Production Reserves, 4 (2 (72)), 6–9. https://doi.org/10.15587/2706-5448.2023.285543
Development of lock-free approach for shared memory organisation in real-time multi-threading applications

Downloads

Published

2024-07-31

How to Cite

Syrotiuk, O. (2024). Development of lock-free approach for shared memory organisation in real-time multi-threading applications. Technology Audit and Production Reserves, 4(2(78), 6–11. https://doi.org/10.15587/2706-5448.2024.309344

Issue

Section

Information Technologies