About 50 results
Open links in new tab
  1. c++ - What is the difference between std::shared_ptr and std::atomic ...

    The atomic "thing" in shared_ptr is not the shared pointer itself, but the control block it points to. meaning that as long as you don't mutate the shared_ptr across multiple threads, you are ok. do note …

  2. What does "atomic" mean in programming? - Stack Overflow

    May 8, 2015 · In the Effective Java book, it states: The language specification guarantees that reading or writing a variable is atomic unless the variable is of type long or double [JLS, 17.4.7]. What do...

  3. c++ - What exactly is std::atomic? - Stack Overflow

    Aug 13, 2015 · Objects of atomic types are the only C++ objects that are free from data races; that is, if one thread writes to an atomic object while another thread reads from it, the behavior is well-defined. …

  4. Concurrency: Atomic and volatile in C++11 memory model

    2) Atomic: Atomic operations modify data in a single clock tick, so that it is impossible for ANY other thread to access the data in the middle of such an update. They're usually limited to whatever single …

  5. What are atomic types in the C language? - Stack Overflow

    Apr 30, 2016 · I remember I came across certain types in the C language called atomic types, but we have never studied them. So, how do they differ from regular types like int,float,double,long etc., and …

  6. What are atomic operations for newbies? - Stack Overflow

    Sep 6, 2018 · Everything works. Note that "atomic" is contextual: in this case, the upsert operation only needs to be atomic with respect to operations on the answers table in the database; the computer …

  7. How to initialize a static std::atomic data member

    Since std::atomic_init has been deprecated in C++20, here is a reimplementation which does not raise deprecation warnings, if you for some reason want to keep doing this.

  8. How to use std::atomic<> effectively for non-primitive types?

    Oct 12, 2023 · The definitions for std::atomic&lt;&gt; seem to show its obvious usefulness for primitive or perhaps POD-types. When would you actually use it for classes? When should you avoid using it for …

  9. java - Volatile Vs Atomic - Stack Overflow

    Java volatile keyword doesn't mean atomic, its common misconception that after declaring volatile, ++ operation will be atomic, to make the operation atomic you still need to ensure exclusive access …

  10. thread safety - Atomic operations in ARM - Stack Overflow

    Aug 10, 2012 · I've been working on an embedded OS for ARM, However there are a few things i didn't understand about the architecture even after referring to ARMARM and linux source. Atomic …