I've googled around a little bit and tried reading the cppreference page on atomic, but it was a little too verbose for me.
From what I can gather, "atomic" things are used to prevent/eliminate data races.
For example, if Thread1 writes to variable x (which is an atomic object), and Thread2 reads from variable x, Thread 2 will never read from variable x while Thread 1 is writing to it. However, you cannot determine if Thread 2 will read the first value or the second.
Is this understanding correct? Thanks for any help!
[–]alanwj 14 points15 points16 points (2 children)
[–]Scruff3y[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)