• 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: Leak while in Midi thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leak while in Midi thread


  • Subject: Re: Leak while in Midi thread
  • From: Craig Bakalian <email@hidden>
  • Date: Sat, 11 Jan 2003 04:38:05 -0500

On Friday, January 10, 2003, at 09:58 PM, email@hidden wrote:

Subject: Re: Leak while in Midi thread
From: Jeff Moore <email@hidden>
To: CoreAudio <email@hidden>

This discussion seems like as good a time as any to remind people that
allocating and deallocating memory inside a time constraint thread such
as this MIDI thread or the HAL's IO thead is flat out bad programming.
The reason why is that the memory calls _will_ block (usually precisely
when you don't want them to) and cause you timing problems that are
very hard to diagnose. This is among the reasons why there are no
autorelease pools in these threads.

To reiterate: don't allocate or deallocate memory in a time constraint
thread owned by the audio or MIDI systems. You will get hurt by doing
so.


So how do we get around this? I am not having timing problems because my app is just getting the tone value or midi value of each midi key press and I am using the numeric key pad to enter the rhythmic value of a given music note. But strange things happen sometimes. Some times the tone value does not change. What do we do when we are using Cocoa?

Craig Bakalian
_______________________________________________
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: Leak while in Midi thread
      • From: Jeff Moore <email@hidden>
    • RE: Leak while in Midi thread
      • From: "Benjamin Golinvaux" <email@hidden>
  • Prev by Date: Re: Leak while in Midi thread
  • Next by Date: RE: Leak while in Midi thread
  • Previous by thread: Re: Leak while in Midi thread
  • Next by thread: RE: Leak while in Midi thread
  • Index(es):
    • Date
    • Thread