PDA

View Full Version : Multithreading on Iphone - how fast is it?




reydan
Oct 23, 2009, 08:58 AM
Hi,

I was wondering if making an application use multiple threads has any effect on performance (good or bad).

For example, is it viable for the networking part of a game to the run on a separate thread? Is there any performance gain/loss?

Thanks,



ghayenga
Oct 23, 2009, 10:54 AM
Hi,

I was wondering if making an application use multiple threads has any effect on performance (good or bad).

For example, is it viable for the networking part of a game to the run on a separate thread? Is there any performance gain/loss?

Thanks,

It's perfectly viable, and it allows the game interface to continue to be used, but of course it does use up CPU and RAM while it's doing it. So it would depend entirely on how CPU and RAM intensive your game is.

PhoneyDeveloper
Oct 23, 2009, 12:09 PM
Current iPhone/iTouch devices are all single core machines. So multiple threads don't give a performance boost. What they do is allow your app to do multiple things at once without much slowdown. If you can do networking with NSURLConnection it has threading built in to how it works so you don't need to write threaded code yourself. However, it is certainly viable to use background threads for any process that can take a while.

firewood
Oct 24, 2009, 12:43 AM
Current iPhone/iTouch devices are all single core machines. So multiple threads don't give a performance boost. What they do is allow your app to do multiple things at once without much slowdown.

On a single core processor, you really can't do "multiple things at once", just things done 1 at at time but chopped up in a different order that's less under your control and more under the OS's control, which can chop up one executing thread to possibly give another better latency.