Cargando…

C++ Atomics: An Overview

<!--HTML-->std::atomic introduced since C++11 is used as a building block for lock free programming. However while the default flags provide the maximum consistency; the do come with a performance penalty and may not be what you want in all cases. We will look under the hood, at a top level on...

Descripción completa

Detalles Bibliográficos
Autor principal: Lekshmanan, Abhishek
Lenguaje:eng
Publicado: 2022
Materias:
Acceso en línea:http://cds.cern.ch/record/2803362
Descripción
Sumario:<!--HTML-->std::atomic introduced since C++11 is used as a building block for lock free programming. However while the default flags provide the maximum consistency; the do come with a performance penalty and may not be what you want in all cases. We will look under the hood, at a top level on what the processor sees when an atomic is encountered, the acquire and release semantics, which are fundamentally what mutexes use; and thus understand what the various memory order flags mean and when it is safe (or unsafe) to use them.