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

Loosing threads in cocoa


  • Subject: Loosing threads in cocoa
  • From: Daniel Aarno <email@hidden>
  • Date: Thu, 8 May 2003 11:13:11 +0200

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.

  • Prev by Date: Re: Memory Management Mismanaged
  • Next by Date: Re: Loosing threads in cocoa
  • Previous by thread: How to receive data from printers?
  • Next by thread: Re: Loosing threads in cocoa
  • Index(es):
    • Date
    • Thread