• 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: Polling Callback, Threads [Attn: Michael Thornburgh]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Polling Callback, Threads [Attn: Michael Thornburgh]


  • Subject: Re: Polling Callback, Threads [Attn: Michael Thornburgh]
  • From: Michael Thornburgh <email@hidden>
  • Date: Thu, 11 Dec 2003 01:22:37 -0800

there are risks doing it that way. the two main ones are:

1) it is recommended that you not allocate memory (which means, no creating objc objects, including NSData objects) during the IOProc. this is because the memory allocation operation can wait on locks that may potentially be locked for extended periods, if lots of paging or swapping has to happen to accommodate your allocation request or allocation requests that may be happening in different threads. that can cause your IOProc to overload/glitch.

2) that way provides no discard-when-too-busy mechanism. if doing your DSP and updating the display, along with whatever else is going on on the computer, takes longer (on average) than the length of time represented by the buffer, then you'll get farther and farther behind AND use more and more memory. neither one of those is desirable.

-mike


On Dec 11, 2003, at 12:29 AM, Daniel Todd Currie wrote:

-[NSObject performSelectorOnMainThread:withObject:waitUntilDone:]

I didn't realize this method exists...

Can't i just make my audio buffer into an NSData and shoot it out with the performSelectorOnMainThread method, setting waitUntilDone:NO? I tried it and it seems to run great. Are there risks involved in this simple solution?

[....]
_______________________________________________
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.

  • Follow-Ups:
    • Re: Polling Callback, Threads [Attn: Michael Thornburgh]
      • From: Daniel Todd Currie <email@hidden>
    • Re: Polling Callback, Threads [Attn: Michael Thornburgh]
      • From: john <email@hidden>
References: 
 >Polling Callback, Threads [Attn: Michael Thornburgh] (From: Daniel Todd Currie <email@hidden>)
 >Re: Polling Callback, Threads [Attn: Michael Thornburgh] (From: Michael Thornburgh <email@hidden>)
 >Re: Polling Callback, Threads [Attn: Michael Thornburgh] (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Re: Polling Callback, Threads [Attn: Michael Thornburgh]
  • Next by Date: Drum Kits in Apple's DLS Synth
  • Previous by thread: Re: Polling Callback, Threads [Attn: Michael Thornburgh]
  • Next by thread: Re: Polling Callback, Threads [Attn: Michael Thornburgh]
  • Index(es):
    • Date
    • Thread