Re: Feeder thread priority
Re: Feeder thread priority
- Subject: Re: Feeder thread priority
- From: Doug Wyatt <email@hidden>
- Date: Mon, 24 Sep 2007 10:30:34 -0700
It may be that your file I/O is competing with other I/O on the same device. It may not be as much a matter of thread priority as the fact that I/O is simply queued without regard for the priority of the thread waiting on the I/O request.
I know, you can't duplicate the problem, but if you could, one thing to try would be to use fs_usage to see if your reads are being held off because there is too much other I/O.
One other thing to make sure of is that your feeder thread is really getting the priority you think. You can observe its actual running priority with the M option to 'ps' or with some of the utility methods of CAPThread.
Doug
On Sep 24, 2007, at 8:20 , Roni Music wrote: Hi,
I'm experiencing a drop out problem when my app runs on certain customers newer MacBooks running OS X 10.4
I can't duplicate the problem on either my dual G4 or my Intel iMac so it's hard to track the problem.
I'm reading the audio data of the files in a separate feeder thread set to what I guess is the highest priority == 63. I'm using the CAPthread class with a fixed priority.
I can simulate the problem by copying a large number of files at the same time as my application is playing. This will interrupt playback from time to time.
It's not that FSReadFork() call in the feeder thread takes a long time (as I first suspected) but rather that the feeder thread is not waked up when it's time. Instead it seems that (in this case), the file copying has a lot higher priority than the maximum priority I'm able to set for my feeder thread. I have tried to fix it with more and larger buffers but it doesn't fix the problem, it just makes the drop outs appear less often so this is not a solution. Whned the drop out appears, the feeder thread is blocked 500 and 1000 ms.
So my questions is:
How can I raise the priority even more on my feeder thread? (I see that the CoreAudio IO callback has a priority 97, much higher than my feeder thread). I suspect the file copying has a higher priority than 63 else it wouldn't block my feeder thread.
So some background processes on my customers MacBooks also works with a very high priority it seems?
Except for the file copying described above, I have never experienced one single dropout on my own machines, this is strange, or?
Any hints?
Thanks, Rolf
-- Doug Wyatt Core Audio, Apple
|
_______________________________________________
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