• 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: Problem killing my threads :)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: Problem killing my threads :)
      • From: Dylan Neild <email@hidden>
References: 
 >Problem killing my threads :) (From: Dylan Neild <email@hidden>)

  • Prev by Date: Re: Request for comments: archive for mailing lists
  • Next by Date: Re: Request for comments: archive for mailing lists
  • Previous by thread: Problem killing my threads :)
  • Next by thread: Re: Problem killing my threads :)
  • Index(es):
    • Date
    • Thread