• 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: Using getrusage function in a CoreAudio callback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using getrusage function in a CoreAudio callback


  • Subject: Re: Using getrusage function in a CoreAudio callback
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 26 Mar 2003 11:23:01 -0800

I don't know too much about getrusage or how it's implemented. From reading the man page, I would guess that it does sysctl or ioctl call or possibly uses a mach message, probably including waiting for a reply, directly. All these mechanisms involve system locks and other things that can block. So, I would expect that calling getrusage from inside an IOProc would interfere with the timing.

When I do profiling of the IO thread, I just use the host time clock as follows:

OSStatus MyIOProc(...)
{
UInt64 theStartTime = AudioGetCurrentHostTime();

do the work;

UInt64 theEndTime = AudioGetCurrentHostTime();

log the performance metrics to a safe place so another thread can write them out;
}

On Wednesday, March 26, 2003, at 10:00 AM, Stephane Letz wrote:

Hi,

I'm using the "getrusage" function to measure CPU use in a CoreAudio
callback. With very small buffer sizes for the CoreAudio callback, the
getrusage call cause gliches as if the getrusage itself was too time
consuming or cause something weird in the kernel.

is this the case? Is there any other way to measure CPU use in this case?

Thanks

Stephane Letz


Grame: Centre National de creation musicale
9, Rue du Garet
69001 Lyon
Tel: 04-72-07-37-00
Fax: 04-72-07-37-01
Web: www.grame.fr
_______________________________________________
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.



--

Jeff Moore
Core Audio
Apple
_______________________________________________
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: 
 >Using getrusage function in a CoreAudio callback (From: Stephane Letz <email@hidden>)

  • Prev by Date: Question Re. Interleaved Sound Input
  • Next by Date: Re: Question Re. Interleaved Sound Input
  • Previous by thread: Using getrusage function in a CoreAudio callback
  • Next by thread: Re: Using getrusage function in a CoreAudio callback
  • Index(es):
    • Date
    • Thread