• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dealing with multiple tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dealing with multiple tasks


  • Subject: Dealing with multiple tasks
  • From: Chad Armstrong <email@hidden>
  • Date: Thu, 1 Apr 2004 00:28:17 -0600

I have a series of tasks (via NSTask) I want to run in a sequential order. Right now I am using a standard FOR loop to run through the tasks, and I use a waitUntilExit call to pause everything until the current task is complete, before moving onto the next step. This works OK, but it seems that I can't interrupt or terminate this task while it is running (say, via a Cancel button). Is there an option here?

Will separating the task ([myTask launch]) into a new thread help at all, or will this just complicate matters? Or should I use notifications and just wait until it is done, then recursively call the next task from the method that was invoked after the previous task was completed? My problem with this last way is that using recursion might start taking up a lot of memory if there are a lot of processes to run through. Any other thoughts on this? From my days of compiler classes, I remember calling recursive functions ended up adding a lot of stack and pointer data. It seems that using a FOR loop reduces a lot of this over head.

Chad Armstrong
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Dealing with multiple tasks
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: NSNotificationCenter not working
  • Next by Date: Re: [Mom list] Mailing-list and Spam challenge
  • Previous by thread: Re: hi
  • Next by thread: Re: Dealing with multiple tasks
  • Index(es):
    • Date
    • Thread