The C standard does not define whether it is atomic or not.
In practice, you never write code which fails if a given operation is atomic, but you might well write code which fails if it isn't. So assume it isn't.
http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Atomic-Builtins.html
I believe that the following code increases the value of var atomically.
volatile int var = 0;
__sync_fetch_and_add( &var, 1 )
I understood the above codes as the following logic:
Load …
Is there a (POSIX-)portable way in C for atomic variable operations similar to a portable threading with pthread?
Atomic operations are operations like "increment and get" that are executed atomically that means that no context switch can interfere with …
Every Modern OS provides today some atomic operations:
Windows has Interlocked* API
FreeBSD has <machine/atomic.h>
Solaris has <atomic.h>
Mac OS X has <libkern/OSAtomic.h>
Anything like that for Linux?
I …