Is single float assignment an atomic operation on the iPhone?

Posted by iter on Stack Overflow See other posts from Stack Overflow or by iter
Published on 2010-03-31T06:55:05Z Indexed on 2010/03/31 7:03 UTC
Read the original article Hit count: 307

Filed under:
|
|
|

I assume that on a 32-bit device like the iPhone, assigning a short float is an atomic, thread-safe operation. I want to make sure it is. I have a C function that I want to call from an Objective-C thread, and I don't want to acquire a lock before calling it:

void setFloatValue(float value) {
    globalFloat = value;
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about multithreading