Does the iOS-Simulator use multiple cores?

2020-08-11 04:41发布

问题:

Now that the iPad 2 comes with two CPU cores, the debugging of threading issues will be more important than ever. Now I'm wondering: Does the iOS-Simulator actually use the multiple cores available on the Mac?

回答1:

To run iOS programs on the simulator, Xcode compiles your program for the Intel processor. The simulator does not emulate an ARM processor, so exact execution of threaded code will differ from an iOS device and the simulator. Regardless of how many cores the iOS simulator uses, threaded code execution may vary greatly between the ARM processors in iOS devices and the Intel processor running on the Mac. Therefore any issues that crop up due to the multicore iPad 2 processor may or may not show up in the simulator.

In other words, you'll want to debug such issues on the iPad 2, not the simulator, so it doesn't matter how many cores the simulator uses.



回答2:

I created a special test app for you. And here is the result: