Quantcast
Channel: Is assigning a pointer in C program considered atomic on x86-64 - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Answer by Peter Cordes for Is assigning a pointer in C program considered...

A plain global char *ptr should not be considered atomic. It might work sometimes, especially with optimization disabled, but you can get the compiler to make safe and efficient optimized asm by using...

View Article



Answer by mevets for Is assigning a pointer in C program considered atomic on...

For almost all architectures, pointer load and store are atomic. A once notable exception was 8086/80286 where pointers could be seg:offset; there was an l[des]s instruction which could make an atomic...

View Article

Answer by Maxim Egorushkin for Is assigning a pointer in C program considered...

Bear in mind that atomicity alone is not enough for communicating between threads. Nothing prevents the compiler and CPU from reordering previous/subsequent load and store instructions with that...

View Article

Answer by Blindy for Is assigning a pointer in C program considered atomic on...

"Atomic" is treated as this quantum state where something can be both atomic and not atomic at the same time because "it's possible" that "some machines" "somewhere" "might not" write "a certain value"...

View Article

Is assigning a pointer in C program considered atomic on x86-64

https://www.gnu.org/software/libc/manual/html_node/Atomic-Types.html#Atomic-Types says - In practice, you can assume that int is atomic. You can also assume that pointer types are atomic; that is very...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images