Top "Atomic" questions

An atomic operation is indivisible.

Which is more efficient, basic mutex lock or atomic integer?

For something simple like a counter if multiple threads will be increasing the number. I read that mutex locks can …

multithreading operating-system pthreads mutex atomic
Initializing std::atomic_bool?

I want to use std::atomic_bool because I want to have a boolean which is supposed to be accessed …

c++ c++11 visual-studio-2012 atomic
Initialize static atomic member variable

I would like to generate identifiers for a class named order in a threadsafe manner. The code below does not …

c++ c++11 constants atomic
gcc atomic built-in functions

http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Atomic-Builtins.html I believe that the following code increases the value of var …

c gcc atomic
UNIX Portable Atomic Operations

Is there a (POSIX-)portable way in C for atomic variable operations similar to a portable threading with pthread? Atomic …

c concurrency posix atomic
Is file append atomic in UNIX?

In general, what can we take for granted when we append to a file in UNIX from multiple processes? Is …

unix file-io posix atomic atomicity
Why is std::atomic<bool> much slower than volatile bool?

I've been using volatile bool for years for thread execution control and it worked fine // in my class declaration volatile …

c++ multithreading performance c++11 atomic
Java: is there no AtomicFloat or AtomicDouble?

I have found AtomicInteger, AtomicLong, but where is AtomicFloat (or AtomicDouble)? Maybe there is some trick?

java concurrency atomic
How to make file creation an atomic operation?

I am using Python to write chunks of text to files in a single operation: open(file, 'w').write(text) …

python file-io atomic
AtomicInteger lazySet vs. set

What is the difference between the lazySet and set methods of AtomicInteger? The documentation doesn't have much to say about …

java concurrency atomic