Cocoa Programming/Multithreading

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Multithreading in Cocoa is just like multithreading in any other *nix application, but there are a couple things you should know.

Not All Cocoa Objects are Thread-Safe[edit | edit source]

Mutable objects are pretty much not thread-safe, and you should attempt to avoid them and find an immutable alternative. If none exists, you can use locks to synchronize the access mutable objects across threads.