Open cignoni opened 8 years ago
The correct implementation would be to run the filter processing code inside a web worker http://www.w3schools.com/html/html5_webworkers.asp
Web worker require an external js file with the code to execute. There are some workaround, like those on https://stackoverflow.com/questions/5408406/web-workers-without-a-separate-javascript-file or the library http://www.eslinstructor.net/vkthread/
Probably it just needs that the emscriptem compiled code is compiled as a webworker
http://stackoverflow.com/questions/32291084/minimal-working-example-for-emscripten-webworker
We shoud add a callback for better managment of long processing task. In this way a filter that take a lot of time from time to time give back the control to the js environmnent (for task like updating a progress bar eventually) and it does not lock the browser. Currently js process that runs for more than a few secs without returning are eligible to be considered as crashed processs...