I need threads because the main thread is a network loop waiting for a connection and when it gets a connection, it spawns a thread like in my example. I need to be able to respond to the client with all the data from the task and I need to close out the connection and release the spawned thread/object.
I need to do this in a reasonable amount of time as well. I cannot just slow down the speed by 1 second as that makes the response to the client 1 second slower. Do you recommend that I work with C APIs to make my own NSTask which works? In response to number 2, how can I stop the run loop and how could I know when I got everything? I don't have any way to verify I got everything. On Jul 31, 2012, at 9:00 PM, Kyle Sluder <k...@ksluder.com> wrote: > 1) Yes, you need to run the run loop forever (NSDistantFuture). > > 2) You don't need to know in advance how much data you need to read. Just > stop running the run loop when you're done. > > 3) Why are you using threads at all? You should just be able to fire off an > NSTask from the main thread and let its run loop take care of notifying you. > > --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com