Posts Tagged ‘web workers’

Flex threading w/ Web Workers

No Comments »

One place where Flash falls short is threading.  Unfortunately it is not possible to create threads using the current version of the Flash Player. (10 point something something at the time of this writing)  What this means is if you have a large dataset you need to parse through, and you simply use an recursive function or iterator, the ActionScript Virtual Machine (AVM from now on) simply enters the loop and nothing else gets processed until this loop is done.  Where this becomes problematic is when it keeps the UI from redrawing.  If the UI becomes unresponsive for a non-trivial amount of time, the user can become frustrated and may stop using your app. Furthermore, if your script takes longer than the predefined (and not really overrideable) amount of time, Flash spits out an execution time limit exceeded error which kills code execution.  And nobody wants any code to be killed. So what we need is a work-around for no threads. Read the rest of this entry »