开发者

Does it make sense to do multithreading on the iPhone?

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.... ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜