License : Creative Commons Attribution 4.0 International (CC BY-NC-SA 4.0)
Copyright :
Frédéric Pennerath,
CentraleSupelec
Last modified : April 19, 2024 10:22
Link to the source : system-programming.md
Since C++11, the standard library proposes to act as a proxy to interact with different aspects of operating systems.
This brings several advantages:
thread
) to have several asynchronous execution threads that can truly run in parallel with the advent of multicore architecturesmutex
) to make synchronous the access to shared ressources and to protect from race conditions.condition_variable
) to signal events between threads.future
) to easily transmit from one thread to another data or exceptions resulting from parallel computation.semaphore
) to count on limited ressources.latch
) and barriers (C++20, file barrier
) to synchronize a pool of threads.atomic
) to control processor pipelines and ensure lock-free synchronous access to memory.chrono
) to sleep for delays, to measure times, etc.filesystem
) to interact with file systems in a standard way (file removal, directory management, etc).Boost.Asio
for an excellent portable implementation of network sockets (in synchronous and asynchronous modes)