Re: Threading/timer issues on Mach-O vs. OS 9
Re: Threading/timer issues on Mach-O vs. OS 9
- Subject: Re: Threading/timer issues on Mach-O vs. OS 9
- From: Stephen Kay <email@hidden>
- Date: Mon, 24 Apr 2006 02:57:47 -0400
on 4/24/06 1:24 AM, Kurt Revis at email@hidden wrote:
>> The lockout flag is a global variable. When the TimerProc is
>> called, every 1
>> ms, if the flag is "true" (locked), you exit and don't process any
>> Scheduled
>> Tasks.
>
> OK, so I'm confused about how this thing gets "stuck". If it's just
> a global variable that's completely under the control of your own
> code, you should be able to figure out what's going on, yes? Nothing
> else in the system is going to touch it.
Yeah, you would think. But it hasn't been easy to track down so far. It gets
set from numerous places. There's something going on with the interaction of
these two threads that I haven't figured out yet, that works quite
differently from OS 9.
> Is this value a simple integer (long or int or whatever) or is it
> some larger structure?
It's just a Boolean.
> Hard to tell anything from just listening to the results -- I bet
> you're getting called back frequently, but the jitter is probably
> pretty high compared to your 1 ms period. Only measuring it will tell
> you for sure. Last time I looked (2002 or so) the high level CF/
> NSTimers wouldn't get you anywhere near 1 ms. I don't know how
> Carbon simulates the Time Manager stuff, but it could well be doing a
> better job.
Well, there must be some way to do it, because I think a number of music
apps work this way. There's one I can think of, offhand, which is Max/MSP,
I'd be interested to know what he's gone to in OS X. Because my original
code is descended from the same type of scheduler used in that. I've sent
him an email.
> Also -- and I know this is beyond the bounds of what you want to do
> right now -- I really recommend that you think about a redesign in
> the future. There's a considerable amount of overhead in making your
> thread wake up 1000 times a second,
Compared to what? Certainly not to processing audio or video.
> and it's especially pointless if
> you do nothing 99.9% of the time. It's entirely possible to get rid
> of all this overhead, and wake up your timer thread only when it has
> actual work to do.
Yeah, I hear what you're saying, but I don't know that a redesign is
required - yet. I'll cross that bridge later.
- Stephen
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Stephen Kay
Karma Lab - developers of KARMA
http://www.karma-lab.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
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