Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

reydan

macrumors newbie
Original poster
Oct 23, 2009
1
0
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,
 
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.
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.