Re: How to kill a thread?
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.