• 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: Update Cocoa object from callback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update Cocoa object from callback


  • Subject: Re: Update Cocoa object from callback
  • From: john <email@hidden>
  • Date: Tue, 27 May 2003 22:19:01 -0400

Would calling performSelectorOnMainThread: very frequently cause any strange overhead that would make it undesirable?

Thanks.

-- John

Calling most of Cocoa's API requires doing so within a block guarded by an autorelease pool. The threads that Cocoa owns itself will arrange for this to be true. However, you are on your own when you are executing code on threads not owned by Cocoa, like the CoreAudio threads.

When I find myself in a situation where I need to call back into Cocoa, I do one of two things. Either I explicitly create an autorelease pool around the block of code in question or, more usually, I make use of -performSelectorOnMainThread:withObject:waitUntilDone: to be sure the work I'm doing gets done on a known safe-for-Cocoa thread.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Update Cocoa object from callback (From: Brian Willoughby <email@hidden>)

  • Prev by Date: Re: Simple test app?
  • Next by Date: Jack audio server for Darwin/MacOSX
  • Previous by thread: Re: Update Cocoa object from callback
  • Next by thread: Re: Update Cocoa object from callback
  • Index(es):
    • Date
    • Thread