Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Sound Manager & MIDI callbacks, interrupts and threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sound Manager & MIDI callbacks, interrupts and threads



Thanks again for more replies.

What I now plan to do is this. I'm going to ignore the instruction not
to put a lock in a callback since some people tell me that in fact a
lock is ok, and no-one has proposed any other way of protecting critical
sections. If anyone is going to tell me again not to do this, then
please tell me what I _should_ do instead. In fact, is the instruction
not to put a lock in a callback a hangover from Classic Mac when the
callback would be running in "interrupt time" rather than a true thread
of its own?

I've downloaded the excellent pthread reference that someone gave a
pointer to:
http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/
V51A_PDF/ARH9RBTE.PDF

And then I wrap pthread_mutex_lock/unlock around the critical bits of
queue manipulation in both the main app code and the callback. Seems to
work ok, I'll think again if it crashes.

Easy when you know how. Thanks again.

Andy Robinson, Seventh String Software, www.seventhstring.demon.co.uk
_______________________________________________
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.