Which integer operations are atomic on the ios/arm platform?

Viewed 909

If I have an integer x, which of the following statements are atomic on the ARM architecture on an iPhone?

int x;
int y;
x = 92;  // . . . . . .   A
x++;     // . . . . . .   B
y = ++x; // . . . . . .   C
printf("x = %d\n", x); // D

I know, that on the i386 platform, statements A, B and D are atomic, while C is not. I'm pretty sure that C is not atomic in iOS. I suspect that basic load and store operations (D and A) are atomic in iOS too, but I'm not sure. Does anyone know more?

How is it with 16 bit and 8 bit values? Or with 64 bit values on the iPhone 5S and with 64 bit values on the iPhone 5 and below?

(If the answer is as I suspect... Is there any platform where basic load and store operations are not atomic?)

1 Answers
Related