Reputation
366
Top tag
Next privilege 500 Rep.
Access review queues
Badges
2 9
Newest
 Explainer
Impact
~14k people reached

  • 0 posts edited
  • 0 helpful flags
  • 9 votes cast
Dec
10
comment Difference between Atomic Operation and Thread Safety?
@user960567 please note that that thread only relates to C# which ensures some operations to be atomic by using atomic operations and correct memory alignment internally.
Dec
10
comment Difference between Atomic Operation and Thread Safety?
None of those is ensured to be atomic on all platforms. You can use platform/compiler dependent methods like InterlockedIncrement or the new std::atomic of c++11. Even setting an integer can cause garbage when it is not aligned to the cache lines of your processor as two operations can result in one part getting written from one write and the other part from the other write, at least on PPC.
Dec
10
awarded  Teacher
Dec
10
answered Difference between Atomic Operation and Thread Safety?