threading questions
threading questions
- Subject: threading questions
- From: Matthew D Hancher <email@hidden>
- Date: Sat, 08 Nov 2003 19:03:14 -0500
Hi. I'm writing a multi-channel audio app using the HAL. I need to be
able to support things like devices being unplugged or reconfigured
while my app is running, so I'm registered as a listener for all sorts
of notifications. Now I'm going through and trying to make my app
properly thread-safe, but I'm not seeing any documentation of how
the HAL works from a threading perspective.
I have seen contradictory answers to even simple questions, such as
whether it is acceptable to use locks in my IOProc. I have been using
non-locking circular buffers, but I'm trying to minimize latency and
so this extra layer of buffering is a little annoying. In what
context is the my IOProc really being called? Is it at hard interrupt
time, is it in the bottom half of an ISR, or is it in a totally
separate thread that does its own circular buffering to the ISR? If I
do block every once in a while while attempting to acquire a lock,
will the drivers notice and try to be "clever" by increasing some
internal buffer size to reduce the odds of future failures and thus
increase my latency?
Next, how do the listener callbacks fit in? Are these also called by
something like an ISR bottom half? Can they interrupt an IOProc or
vice versa? For that matter, can one IOProc interrupt another IOProc?
Am I just missing someplace where all of this is documented?
Thanks very much,
Matt
_______________________________________________
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.