What is the difference between primitive and atomic types?
What is the purpose of atomic types?
In what situations are they applied?
What is the difference between primitive and atomic types?
What is the purpose of atomic types?
In what situations are they applied?
There is a big difference between primitive types and atomic types.
Atomic types are free of data races and can be modified and / or accessed by two different threads. An atomic data is widely used when, for example, we have 2 distinct actions that are executed in this data, such as reading and writing, this type of data is also widely used in operating systems, where it is necessary for a data to be accessed by different threads.
It's wrong to say that, but it would be something close to an asynchronous operation.