Re: Preparing the vote on the data race issue

On Wed, Jul 31, 2013 at 11:24 AM, Jer Noble <jer.noble@apple.com> wrote:

> On Jul 30, 2013, at 4:08 PM, Robert O'Callahan <robert@ocallahan.org>
> wrote:
>
> What does it mean for the AudioBuffer.channels array to be "read-only"? I
> don't think that makes sense actually. I'd replace this with
> getChannel(channelNum) instead.
>
>
> [1] "Arrays can also be designated as being read only. User code cannot
> modify the values of read only array elements. If an array is read only,
> then it is also implicitly fixed length."
>

Oops, right.


>
> The AudioBuffer constructor that takes an array (or sequence) of
> Float32Arrays needs to specify that it copies the contents of those arrays
> (I believe that's your intent?).
>
>
> Yes, as Ehsan pointed out, this should be a sequence, which requires that
> the contents are passed by value[2], not by reference.
>

Yes, but you still need to specify that the contents of the Float32Arrays
are copied.


> Are they fresh AudioBuffers every time an event fires, or do values get
> reused?
>
>
> Implementation detail.
>

I don't think so. Scripts can observe whether the AudioBuffer passed in an
event is the same as AudioBuffers previously passed to the event, by
storing a reference to the previous AudioBuffers and comparing references.
Even worse, someone might do something like
scriptProcessorNode.onprocess = function (event) {
bufferList.push(event.inputBuffer); };
in which case it definitely matters whether AudioBuffers are being reused!


>
> And what is the state of the initial outputBuffer object?
>
>
> What is the state now?
>

Not super well specified. I think you want to say it's an empty (zero)
buffer with numberOfOutputChannels channels each of length bufferSize (both
values taken from createScriptProcessor), and "not currently in use". (Does
it go into the NO_MODIFICATION_ALLOWED_ERR state when the event handler
returns?)

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
*

Received on Tuesday, 30 July 2013 23:45:26 UTC