• 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
detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
      • From: Chris Hanson <email@hidden>
    • Re: detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Dragging a file and place it inside a Menu
  • Next by Date: detecting mouseDrag event in NSView
  • Previous by thread: Re: Dragging a file and place it inside a Menu
  • Next by thread: Re: detachDrawingThread:toTarget:withObject: vs detachNewThreadSelector:toTarget:withObject:
  • Index(es):
    • Date
    • Thread