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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleIs 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
More Pages to Explore .....