Multithreading on Iphone - how fast is it?

Discussion in 'iOS Programming' started by reydan, Oct 23, 2009.

  1. macrumors newbie

    Oct 23, 2009

    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?

  2. macrumors regular

    Jun 18, 2008
    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.
  3. macrumors 68030


    Sep 2, 2008
    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.
  4. macrumors 604

    Jul 29, 2003
    Silicon Valley
    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.

Share This Page