Re: Can I create a thread with a runloop and a dispatch queue?
Re: Can I create a thread with a runloop and a dispatch queue?
- Subject: Re: Can I create a thread with a runloop and a dispatch queue?
- From: Charles Srstka <email@hidden>
- Date: Thu, 03 Oct 2013 20:22:50 -0500
On Oct 3, 2013, at 6:06 PM, Kyle Sluder <email@hidden> wrote:
> Other people have addressed the dispatch_get_current_queue() problem.
> Andy Matuschak has opined that the correct way to design an API that
> accepts a block argument is to also accept a dispatch queue on which to
> run that block.
The problem I see with queue arguments is that there are two types of queues that people might be using — dispatch_queue_t and NSOperationQueue — and there doesn't seem to be a way to convert one into the other. So if you design your API to take an NSOperationQueue argument and your caller is using dispatch queues, or vice-versa, then your caller is up a creek, unless you go to the trouble to create two versions of each API, one for each type of queue.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden