mxochicale / code

:computer: :school_satchel: code
0 stars 0 forks source link

What is a std::atomic? #68

Open mxochicale opened 4 months ago

mxochicale commented 4 months ago

What is an atomic operation? An atomic operation is an operation guaranteed to execute as a single unified transaction. When an atomic operation is executed on an object by a specific thread, no other threads can read or modify the object while the atomic operation is in progress. This means that other threads will only see the object before or after the operation — no intermediary state. https://ryonaldteofilo.medium.com/atomics-in-c-what-is-a-std-atomic-and-what-can-be-made-atomic-part-1-a8923de1384d