If all you have is dispatch_queue_t , which was passed to you by someone else, you do not know. This information is effectively hidden from you. If you create the queues yourself, you can use dispatch_queue_set_specific and dispatch_queue_get_specific to put the value in the queue context data and then read it back, but if you do not create the queue, you are lucky.
FWIW, that kind of hint of a fragile design / anti-pattern. Taking a queue as a parameter, you must plan the blocks for future execution in this queue. From this point of view, it does not matter whether the queue is parallel or sequential.
Moreover, your code should be written in such a way that it does not matter if it runs in a sequential or parallel queue. If it uses shared resources, then it must synchronize access to these resources, so if it should be executed in a parallel queue, access to these resources will be safe. Conversely, avoid situations where starting in a sequential queue will be a problem (i.e., do not try to achieve recursive locks with dispatch_sync with a queue that may be sequential.)
ipmcc source share