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 C开发者_开发知识库PU power. Is threading a solution to at least quickly switch between two processes - the heavy stuff and responding to user interaction?
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.
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.
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.... ;)
精彩评论