fpizlo at apple.com
Tue Sep 22 08:59:59 PDT 2015
> On Sep 22, 2015, at 8:32 AM, Stéphane Letz <letz at grame.fr> wrote:
> - we generate optimized asm.js code from a Domain Specific Language (actually an asm.js module for the audio code itself + some additional standard JS functions)
> - the asm.js module contains a "compute" function that receive an array of input float buffers, process them, and returns an array of output float buffers.
> - the array of input float buffers is typically got from a realtime CoreAudio audio callback, and the array of output float buffers has to be given back to the callback. So we would basically need to transfer C float arrays to the asm.js code and back.
> Now the questions :
> - since the asm.js code does not allocate memory, we hope calling the asm.js "compute" function directly form the CoreAudio callback will work, so basically that asm.js code can be called from a real-time callback. Is that a correct assumption?
It's true that in steady state, asm.js code probably won't allocate memory. But I order to execute the code the engine will parse things, compile things, and generate code - all of which requires memory allocation and may acquire locks held by lower priority threads. So, using JSC from a real time callback seems dangerous even if you're using asm.js.
Would this help: https://bugs.webkit.org/show_bug.cgi?id=120112
> Thanks for any advance or code example to look at.
> Stéphane Letz
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev