About 50 results
Open links in new tab
  1. 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. …

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

    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. Do we have atomic uint32 type in C? - Stack Overflow

    Apr 4, 2018 · sig_atomic_t is a typedef of int. But I am curious do we have an atomic type which is matched to uint32_t ?

  4. std::atomic | compare_exchange_weak vs. compare_exchange_strong

    std::atomic | compare_exchange_weak vs. compare_exchange_strong [duplicate] Ask Question Asked 15 years ago Modified 5 years, 2 months ago

  5. How to guarantee atomic move or exception of a file in Java?

    Aug 11, 2014 · You can pass ATOMIC_MOVE as an option, but if the move cannot be performed as an atomic operation, AtomicMoveNotSupportedException is thrown (this is the case when target …

  6. 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 …

  7. std::atomic<bool>::wait vs. std::condition_variable::wait

    Jan 16, 2024 · @anatolyg if waiting through std::atomic_bool::wait is somehow inferior to waiting on std::condition_variable, then that'd be a reason to use the old version, at least in some cases. It's a …

  8. c++ - the gist behind atomic shared pointer - Stack Overflow

    Jan 23, 2025 · At least atomic<shared_ptr<T>> gives you per-object locking, instead of a single lock for the whole stack. So multiple threads can be waiting for different locks if multiple pops start in parallel.

  9. Is incrementing an int effectively atomic in specific cases?

    The reason num++ appears to be atomic is because on x86 machines, incrementing a 32-bit integer is, in fact, atomic (assuming no memory retrieval takes place). But this is neither guaranteed by the c++ …

  10. When should std::atomic_compare_exchange_strong be used?

    Jul 29, 2013 · There are two atomic CAS operations in C++11: atomic_compare_exchange_weak and atomic_compare_exchange_strong. According to cppreference: The weak forms of the functions are …