Re: Problem killing my threads :)
Re: Problem killing my threads :)
- Subject: Re: Problem killing my threads :)
- From: Ondra Cada <email@hidden>
- Date: Mon, 23 Sep 2002 13:17:11 +0200
On Monday, September 23, 2002, at 06:57 , Dylan Neild wrote:
...but what about _terminating_ threads with pthreads calls?
You should not kill threads. The problem is that that way you can't ever
be sure that
they are done and they're resources have been cleaned up
Anyone please correct me if I am wrong, but so far as I know, the right
way is
(a) to ask the thread so that it terminates cleanly itself;
(b) to use any normal way of communication for this request (like a shared
variable or DO or whatever you use);
(c) then just wait for the thread termination.
And, of course...
(d) if a thread contains a bug which prevents its termination, to kill the
whole task -- which would clean up all the resources properly.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.