I have a requirement to execute a small set of related tasks on a custom thread created for them. The tasks will be scheduled from different classes.
I'm planning to use GCD's dispatch_queue_create to create the custom thread and schedule the task on it. Note that all the related tasks must execute only on that one thread in order.
So my question is if I call dispatch_queue_create("my_custom_thread_label", NULL) with the same label from many classes in my codebase, would it all eventually map to just one thread? Or do I need to create it in one place and get a reference to it whenever needed? Thanks.
You need to create it in one place and pass the pointer around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With