Thanks
Thanks

Reputation: 40329

How does multithreading on iPhone OS work? How do I use it?

I am curious about threads on iPhone. Are they easy to establish and to maintain? How does it work on the iPhone? Is it real multithreading?

Upvotes: 4

Views: 10612

Answers (5)

steve smiths
steve smiths

Reputation: 21

If you want to develop efficient, smooth-running applications, controlling concurrency and memory are vital. Automatic Reference Counting is Apple's game-changing memory management system, new to Xcode 4.2. Pro Multithreading and Memory Management for iOS and OS X shows you how ARC works and how best to incorporate it into your applications. Grand Central Dispatch (GCD) and blocks are key to developing great apps, allowing you to control threads for maximum performance.
There is lots of books and courses available for it.

Upvotes: 2

MiKL
MiKL

Reputation: 1850

I would strongly suggest to have a look at the following documentation from Apple:

For most common concurrent programming operations the use of NSOperation and NSOperationQueue both part of Grand Central Dispatch is very easy to implement and will cover most of the operations you need to perform asynchronously including the definition of dependencies between such operations.

Using GCD is simpler that using threads and is going to completely replace them in situations where you don't need real time processing from a parallel thread.

Upvotes: 3

thvanarkel
thvanarkel

Reputation: 1611

Using Grand Central Dispatch is the best way to multithread on the iPhone, it's not that difficult to implement if you stick to the rules. Check the documentation and programming guides.

Upvotes: 1

Jens Ayton
Jens Ayton

Reputation: 14558

With the NSThread class, yes, well, and yes. :-)

Upvotes: 3

Related Questions