Re: Grand Central Dispatch vs CFRunLoop
Re: Grand Central Dispatch vs CFRunLoop
- Subject: Re: Grand Central Dispatch vs CFRunLoop
- From: Ken Thomases <email@hidden>
- Date: Sat, 19 Sep 2009 05:57:54 -0500
On Sep 16, 2009, at 1:47 PM, Chris Kane wrote:
On Sep 13, 2009, at 9:18 PM, Ken Thomases wrote:
With respect to NSTask, there's no reason to believe that it will
work if you just run the main dispatch queue rather than running
the NSRunLoop. I highly doubt it would.
I think it will work fine as long as you don't want the
NSTaskDidTerminateNotification and related (ie, -isRunning to return
the right answer) and anything else the NSTask might do as a result
of the child process dying.
Well, all that stuff that won't get done is what I meant by it not
working. ;) In particular, there have been numerous reports on this
list that NSTask fails to clean up various resources if it's launched
from a background thread and then that thread is allowed to exit
rather than running its run loop until the task completes. I would
expect that same sort of leak might occur if you use dispatch_main()
rather than running the NSRunLoop.
Cheers,
Ken
_______________________________________________
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