NSTask dilema...
NSTask dilema...
- Subject: NSTask dilema...
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Wed, 31 Mar 2010 14:21:28 -0400
I have to run a bunch of NSTasks and I'm not sure to proceed considering I want to be able to update the UI when a task is completed, and I want the process to be as fast as possible (obviously)...
So far I tried a couple of ideas but they all had their problems:
- I tried launching the tasks on the main thread but it locks up my UI and I can't update my progress bar...
- If I try to dispatch each task in the background using GCD (dispatch_group_async and the global queue), it works just fine (and it's really fast too!), but I can't use NSTask's waitUntilExit (I know NSTask is not thread safe but I'm not sharing any NSTasks between threads...however, using waitUntilExit makes the app crash...badly...)... so basically I can use GCD to dispatch the NSTasks but then there's no way to be notified when the task are completed....(obviously I'm not receiving the NSTaskDidTerminateNotification notification either since each tasks are launched in a different thread)
So I guess my question is... if using threads prevents me from using waitUntilExit... and launching them on the main thread locks up my UI... is there anything I am missing?
Any help would be appreciated
Jean-Nicolas Jolivet_______________________________________________
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