You can get the current thread with +[NSThread currentThread] . This may have a name property, but if you haven't set it, don't rely on it.
Queues are more complicated because there are different "queue" values. The queue can be an NSOperationQueue , and you can get its name from +[NSOperationQueue currentQueue] (again, if you set it).
Then there are the dispatch queues. You can get the current queue using dispatch_get_current_queue() , but you should warn that this function will succeed even if it is called from code that is not associated with the queue (!). In this case, it returns the default background queues. The queues are marked, so you can call dispatch_queue_get_label() , and if you created a queue with a label, you will get this.
So, in principle, yes, you can get a queue or thread - provided that all the code has an associated dispatch queue, even if it is not the code that was sent. You can also get meaningful names for these threads and queues, which is convenient for debugging: but you are responsible for their name.
user23743
source share