detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
- Subject: detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
- From: Antonio Nunes <email@hidden>
- Date: Wed, 27 Sep 2006 11:56:06 +0100
Hi,
Since I've started using threads in my application I've very
occasionally seen and have received (a very few) reports of random
crashes and have not been able to determine the causing factor(s)
yet. The one place in my code where I know problems could occur I've
made thread safe using @synchronize. The crashes appear to be (very)
infrequent and happen in different threads and different places,
usually in framework code (eg in NSPopAutoreleasePool after a call to
NSApplication _startDrawingThread, and in NSUndoManager
forwardInvocation: after a call from an application function that
adds an action to the undomanager).
As a convenience I use detachDrawingThread:toTarget:withObject: to
start the threads, even though they do not actually perform any
drawing. According to my reading of the docs the only difference with
detachNewThreadSelector:toTarget:withObject: is the automatic
creation of an autorelease pool.
Are there any other, non documented, differences, I should know
about? Is the choice between using
detachDrawingThread:toTarget:withObject: vs
detachNewThreadSelector:toTarget:withObject: really that simple or is
there more to it than meets the eye?
Any info greatly appreciated,
António
-----------------------------------------
Accepting others as they are
brings a wonderful freedom
to your own mind.
--The Peace Formula
-----------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden