Top "Atomic" questions

An atomic operation is indivisible.

should LOCK_EX on both read & write be atomic?

file_put_contents ( "file", "data", LOCK_EX ) for writing (which means - aquire lock and write) file_get_contents ( "file", …

php locking blocking atomic atomicity
Which is threadsafe atomic or non atomic?

I searched and found immutable are thread safe while mutable is not. This is fine. But i got misleading notes, …

objective-c multithreading cocoa thread-safety atomic
AtomicInteger and volatile

I know volatile allows for visibility, AtomicInteger allows for atomicity. So if I use a volatile AtomicInteger, does it mean …

java multithreading thread-safety atomic volatile
Volatile or synchronized for primitive type?

In Java, assignment is atomic if the size of the variable is less than or equal to 32 bits but is …

java multithreading atomic volatile synchronized
writeToFile:atomically: what does atomically mean?

I am wondering what the atomically: parameter stands for in the writeToFile:atomically: method (-[NSArray writeToFile:atomically:] for example). …

ios objective-c cocoa-touch atomic writetofile
How do I build a lockless queue?

I've spent today looking into lockless queues. I have a multiple producer, multiple consumer situation. I implemented, for testing, a …

language-agnostic queue atomic lockless
How to implement thread safe reference counting in C++

How do you implement an efficient and thread safe reference counting system on X86 CPUs in the C++ programming language? …

c++ multithreading atomic reference-counting
Does it make any sense to use the LFENCE instruction on x86/x86_64 processors?

Often in internet I find that LFENCE makes no sense in processors x86, ie it does nothing , so instead MFENCE …

assembly x86 x86-64 atomic memory-barriers
Lock Free Queue -- Single Producer, Multiple Consumers

I am looking for a method to implement lock-free queue data structure that supports single producer, and multiple consumers. I …

c++ queue atomic lock-free
Is it possible to create an atomic vector or array in C++?

I have some code which uses an array of int (int[]) in a thread which is activated every second. I …

c++ arrays multithreading vector atomic