Do 2 objects creating serial queues with the same name share the same queue Do 2 objects creating serial queues with the same name share the same queue ios ios

Do 2 objects creating serial queues with the same name share the same queue


As Apple's documentation states, the label is:

A string label to attach to the queue to uniquely identify it in debugging tools such as Instruments...

It is used as a hint, nothing more.

EDIT

Here's the code you want for using a shared queue.

+ (dispatch_queue_t)sharedQueue{    static dispatch_queue_t sharedQueue;    static dispatch_once_t onceToken;    dispatch_once(&onceToken, ^{        sharedQueue = dispatch_queue_create("MyQueue", NULL);    });    return sharedQueue;}


dispatch_queue_create does exactly what the name suggests, it creates a dispatch queue. The label you give it is not required to be unique, it is just used for debugging purposes.