• 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: Thread count strangeness using PlayAudioFile sample code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread count strangeness using PlayAudioFile sample code


  • Subject: Re: Thread count strangeness using PlayAudioFile sample code
  • From: "Chris Weare" <email@hidden>
  • Date: Tue, 29 Mar 2005 13:23:24 -0800

If there is a concern about creation cost then why is a new thred being created each time. I would think that if the concern is to not pay the creation cost when you are ready to go then a good pattern to use is a thred pool where the threads are created up front during init time then round-robin through the work.

Paying for each creation AT call time in the hopes that one MIGHT save later seems odd.

-chris

From: Shawn Erickson <email@hidden>
To: Robert Martin <email@hidden>
CC: email@hidden
Subject: Re: Thread count strangeness using PlayAudioFile sample code
Date: Tue, 29 Mar 2005 07:26:17 -0800


On Mar 29, 2005, at 6:29 AM, Robert Martin wrote:

It works fine, but I ran top and noticed that after each call to PlayAudioFile, my thread count permanently increases by 1. I'm new to threads and cannot figure out what's causing this - or even whether I should worry about it.

Likely nothing to worry about at all. Use shark (part of the CHUD tools from Apple) or thread viewer to see if that thread is doing anything when not using audio units, etc. I bet it would simple block waiting for work.


Can anyone point me in a direction to understand what's going on?

I bet the thread is created lazily and will stay around waiting for work while your application continues to run. This is likely done to avoid thread creation overhead if you are starting and stopping unit often, etc.


Similar things happen with the GUI heartbeat thread used by AppKit for animation effects.

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Thread count strangeness using PlayAudioFile sample code
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Thread count strangeness using PlayAudioFile sample code (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: AUBufferList::CopyBufferContentsTo()
  • Next by Date: Re: Thread count strangeness using PlayAudioFile sample code
  • Previous by thread: Re: Thread count strangeness using PlayAudioFile sample code
  • Next by thread: Re: Thread count strangeness using PlayAudioFile sample code
  • Index(es):
    • Date
    • Thread