What is the difference between dispatch_get_global_queue and dispatch_queue_create?

后端 未结 3 1260
星月不相逢
星月不相逢 2020-12-22 22:39

I\'m writing a moderately complex iOS program that needs to have multiple threads for some of its longer operations (parsing, connections to the network...etc). However, I\'

3条回答
  •  失恋的感觉
    2020-12-22 23:34

    One returns the existing global queue, the other creates a new one. Instead of using GCD, I would consider using NSOperation and operation queue. You can find more information about it in this guide. Typically, of you want the operations to execute concurrently, you want to create your own queue and put your operations in it.

提交回复
热议问题