Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sound Manager calls thread safe?



On Tue, 29 Nov 2005 21:01:29 David Niemeijer <email@hidden> wrote:

> I have been looking at the headers but find no info on whether the calls below
> are supposed to be thread safe or not. Don't know whether that is a good or
> bad sign :-)

Bad sign. I don't remember whether it was said loud but Sound Manager
is deprecated or soon to be so. It was in development before threads
and Mac OS X. There are good chances some of it will work in threads
but there are equally good chances it will be marked deprecated in
Tiger+1 (or is it already?) and removed completely in Tiger+2.

> SndNewChannel
> SndDoImmediate
> SndPlay
> I would love this to be thread safe on 10.2 and higher. does anyone know?

"and higher"? See above.

The closest thing documented at the time was memory moving behavior
and interrupt safety. One would assume that interrupt safety is
stronger safety (if something is interrupt safe it is reasonably to
assume it is thread safe, though this is not true in general).
Among the above calls SndDoImmediate (and SndDoCommand) are
interrupt safe *provided* the channel is "prerolled" with the same
kind of sound (same compression, same rate/sample size, etc). Ditto
SndPlay if it is provided with preallocated and "prerolled" channel
and async, though memory fades on this. SndNewChannel is definitely
not (the usual practice was to allocate it and preroll it at system
time).

Mike

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Sound Manager calls thread safe? (From: David Niemeijer <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.