I have some doubt in writing code for Multi core Devices. Initially up to iPhone 3GS iPhone were having single core CPU. So when I did Application for 3GS and if I were wrote code in multiple thread, then if I run the Application in iPhone 4 or iPad 2 (Dual Core), does iOS assign these multiple threads to different cores? Or is there any thing to do from a developers side to harvest the benifits of multicore CPU features. Is this the resposibility os iOS to assign different thread to different core? And also suppose there is a function which takes long time to execute, and I am calling this code in currrent thread (No multiple threads were created) does iOS split the big task into two smaller ones and execute in different cores?
If you write your code using the thread primitives, the OS will automatically handle core management.
Furthermore, if you use GCD, it will optimize the core and thread management for you.
Bottom line, use GCD (either directly or through helpers like NSOperationQueue), and the system will automatically tune access to system CPU resources, whether you are on a single or multiple CPU architecture.