Loosing threads in cocoa
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.