Open main menu

CDOT Wiki β

Changes

DPS921/ND-R&D

1 byte added, 10:26, 28 November 2018
Synchronization
=== Synchronization ===
 
 
==== Using Atomic ====
 
Another way to manage shared data access between multiple threads is through the use of the atomic structure defined in the <atomic> library.
 
Atomic in the C++11 library works very similarly to how Atomic works in OpenMP. In C++, atomic is used as a wrapper for a variable type in order to give the variable atomic properties - that is, it can only be written by one thread at a time.
 
==== Using Mutex ====
[[File:Cppmutexoutput.png | 300px]]
 
 
==== Using Atomic ====
 
Another way to manage shared data access between multiple threads is through the use of the atomic structure defined in the <atomic> library.
 
Atomic in the C++11 library works very similarly to how Atomic works in OpenMP. In C++, atomic is used as a wrapper for a variable type in order to give the variable atomic properties - that is, it can only be written by one thread at a time.
44
edits