I have been trying to read up on GCD and trying to figure it out. I read a lot of places, that one should always use GCD, if one is doing some heavy work, which will freeze up the UI, and I do understand that, but could GCD also be used just for performance sake. Say I have a loop that need to run 10 times, each iteration being data heavy. Would it improve performance to run half of these iterations of a different thread, so that two threads are sharing the workload or will it still take the same amount of time to go through the loop?
Share
It would help running two serial gdc queues if your device has two processors. However, the idea is that you shouldn’t care, call
dispatch_queue_createwithDISPATCH_QUEUE_CONCURRENTand let the device figure out what is the optimum number of tasks to run in parallel.