• 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
Re: Loosing threads in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loosing threads in cocoa


  • Subject: Re: Loosing threads in cocoa
  • From: "Jean-Olivier Lanctôt-D." <email@hidden>
  • Date: Thu, 8 May 2003 07:02:18 -0400

Q2: Returning the function is enough.

Q1: I guess your problem might be related to the progress indicator.. (is you use setThreadedAnimation or something).
BTW, watch out, don't use AppKit objects in another thread (do it in the main thread, or use DO).

Good luck

--Jean-Olivier

On Thursday, May 8, 2003, at 05:13 AM, Daniel Aarno wrote:

Hi all! I have a thread related question.

Q1:
I have a document based Obj-C cocoa app that in response to opening a document basically does the following:

Display a document window, creates a new NSThread that starts a threaded progress indicator. This new thread forks of a new process (using NSTask), waits for this progress to exit, cleans up, stops the progress indicator and exits.

The problem is that when waiting for the NSTask to exit there are 4 threads running, which could be ok I guess, but when the task has exited there are still 2 threads running, where there should only be one. This makes the application sit and waste about 0.5% of CPU power switching between these threads.

Any pointers?

Q2:
Also do I have to explicitly call [NSThread exit] (which I do now), or is it enough to simply return from the thread function?

/Bishop
_______________________________________________
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.
_______________________________________________
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: Loosing threads in cocoa
      • From: sinclair44 <email@hidden>
  • Prev by Date: Re: How drag files from an NSTableView?
  • Next by Date: Re: Song dragged from iTunes
  • Previous by thread: Re: Loosing threads in cocoa
  • Next by thread: Re: Loosing threads in cocoa
  • Index(es):
    • Date
    • Thread