• 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: How to kill a thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to kill a thread?


  • Subject: Re: How to kill a thread?
  • From: Philip George <email@hidden>
  • Date: Sun, 19 Jan 2003 19:08:22 -0600

From the OS X Documentation Article: "Programming Topic: Multithreading" :

"NSThreads are built upon POSIX threads (pthreads). You can create your own pthreads, but some Cocoa classes, such as NSAutoreleasePool, expect to be running within an NSThread and may not work properly in a pthread. Creating a pthread does not notify Cocoa classes that the application has become multithreaded, so the NSThread method isMultiThreaded may return NO."

You can easily avoid these two issues:

[01] Retain and explicitly release any variables that will
be used inside the pthread function, so that
NSAutoreleasePool isn't in the picture..
[02] Don't use/trust the method "isMultiThreaded". This
functionality can be easily (very easily) implemented
in your own code.

(Also, don't forget about the global ivars issue that i explained how to work around earlier.)

- Philip
_______________________________________________
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: Examples of applications developed with Cocoa?
  • Next by Date: Re: Hacker's Fate
  • Previous by thread: Re: How to kill a thread?
  • Next by thread: Is a file used by another application?
  • Index(es):
    • Date
    • Thread