What's the difference between the “global queue” and the “main queue” in GCD?

前端 未结 4 751
感动是毒
感动是毒 2020-12-12 14:22

Among some other ways, there are these two ways to get queues in GCD:

dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

dispatch_g         


        
4条回答
  •  北海茫月
    2020-12-12 14:59

    Global dispatch queue :

    1. Tasks in concurrent queue executes concurrently [background threads]
    2. Tasks are still started in the order that they were added to the queue

    Main dispatch queue :

    1. Available serial queue that executes tasks on the application's main thread.
    2. It is usually called from a background queue when some background processing has finished and the user interface needs to be updated.

提交回复
热议问题