Atomics on the iphone


#1

When compiling the jucedemo for the iphone (device only, simulator is fine), I’m getting the same error referenced by Bruce here:
http://www.rawmaterialsoftware.com/viewtopic.php?f=5&t=5018&hilit=iphone

except on mac / xcode.

Naturally it works in the simulator (which is x86) but not the device (which is arm6 /arm7).


#2

Ok, I’ll check that asap.


#3

There’s no atomic instruction on ARM9 (I doubt iphone is using ARM6 - or 7).
Under linux, the atomic code is implemented by calling a kernel function pointer from userspace (to avoid process switch cost), see here: http://gcc.gnu.org/wiki/Atomic

As Iphone doesn’t run linux, either Apple implemented something equivalent, either you can’t use Atomic.
You have to know that ARM9 can’t load a 32bits variable in one shot (no 32 bits read is atomic on ARM9).
So the juce::Atomic class isn’t enough on ARM9 for real atomic operation anyway.


#4

Ok, it looks like the GCC atomics aren’t supported before the 3.2 SDK - I’ll add some fallbacks for building on the old OS versions.


#5

Oh … and I’ll update to 3.2. Hadn’t noticed the update.

Thanks -