views:

120

answers:

3

I'm not sure but the iPhone has no multicore-CPU. So does it make sense to put effort into multithreading or is that just a waste of time?

I am doing some heavy stuff which lets my whole UI freeze up until that's done. Now that stuff seems to be so heavy that it just sucks up all the CPU power. Is threading a solution to at least quickly switch between two processes - the heavy stuff and responding to user interaction?

+1  A: 

Yes, because you never know, at some point, there may be a multicore cpu in an iPhone (if there isn't now), and your app will support it.... ;)

Nick Haslam
+6  A: 

Yes, it does make sense to have multiple threads. Specially if you are performing some kind of I/O (disk, network), your application will be much more responsive if you don't block while waiting for input or output to happen.

Even if your CPU if 100% consumed by your application, UI will still respond and not freeze if you do your heavy computation in a separate thread.

Pablo Santa Cruz
+2  A: 

You don't need multiple cores to take advantage of multi-threading (multi-threading has been around a lot longer than multi-core CPUs).

It will allow you to start processes in the background so that your UI remains responsive, thus leading to an improved User Experience with your application.

...so yes, put the effort in to multithreading.

Justin Niessner