Re: Time Problem with NSThread
Re: Time Problem with NSThread
- Subject: Re: Time Problem with NSThread
- From: William Stewart <email@hidden>
- Date: Mon, 2 Jan 2006 12:33:16 -0800
On 30/12/2005, at 11:25 AM, Wayne Anderson wrote:
Hello,
Our app currently is using an NSThread to run a timing loop that
gets events from a Music Sequence. These events are then passed on
to an internal processor that fills an internal buffer with
samples. The Core Audio render thread then draws from this buffer
on each render call. This scheme works fine on a dual processor G5
but on a 1.67 MHz PowerBook our internal NSThread occasionally gets
blocked for a very long time (long in computer terms at least) on
the order of 100 milliseconds. The block always seems to coincide
with the Core Audio render thread grabbing processor time. The
only thing we are doing on the render thread is calling memcpy to
move data to the supplied ABL. Setting the priority on the
NSThread seems to make no difference.
Is this kind of long blocking behavior normal?
Should we resort to a posix thread, or should we make use of ring
buffers or some other construct to process our events ahead of time
to make the app insensitive to this kind of thread timing jitter.
The MusicSequence API provides a user callback for user events -
Events are scheduled by the MusicPlayer of a sequence on the I/O
thread that the player is playing too. This guarantees both sample
accurate scheduling. So, the user event/callback is provided so you
can tap into the same scheduling services and avoid the kind of
polling/scheduling you are trying to do. I would recommend you look
at using this method to schedule your events.
Bill
Any suggestions would be appreciated,
Wayne Anderson
__________________________________
Wayne Anderson
Red Rock Software, Inc.
10 West Broadway, Suite 850
Salt Lake City, UT 84101
http://www.redrocksw.com
office: 801.322.4322 ext: 106
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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