Using a single shared background thread for iOS data processing?

后端 未结 3 896
南旧
南旧 2021-02-10 06:38

I have an app where I\'m downloading a number of resources from the network, and doing some processing on each one. I don\'t want this work happening on the main thread, but it\

3条回答
  •  [愿得一人]
    2021-02-10 07:17

    I would use NSOperationQueue or GCD and profile. Can't imagine thread overhead will beat out network delays.

    NSOperationQueue would let you limit the number of simultaneous operations, if they end up getting too greedy. In fact, you can limit it to one if you need to.

提交回复
热议问题