Threading in Flex
Most applications require you, at one time or another, to process something behind the scenes whilst you get on with something else up front. If you’re familiar with Java you will be familiar with the threading model it employs.
Flex, however, is single-threaded. Or to be more precise the ActionScript 3.0 execution model is single threaded. This can lead to occasions where you see the UI freeze as it attempts to process some CPU intensive computations.
An issue of this is that there is no capability for yielding or blocking in the code. You will have encountered this if you’ve ever tried to debug by using multiple Alert.show() messages in a single function (hint: they all pop-up).
The solution to this, has been to write you’re own code to chop the processing up into manageable chunks and then write some code to manhandle that. Not a nice way to go about things. Luckily someone out there has developed a neater solution.
John Blanco is a RIA developer with quite a few years of Flex/Flash under his belt, his solution to the problem, called Ender’s Lib, can be found here.
|
|
|
|
|
|
|







Nice work! I’ll have to do a cross post on this one
Man, that’s great…Thanks for providing such a good info………
Thanks a lot!! a very useful topic!!
Thanks for this. It really helped me out!
Thank you very much for this post.
Very useful information
Very useful information. Thank you.
This is absolutely perfect. Thanks a lot, I’ve been looking for something like this for a long time.
Great post! Just wanted to let you know you have a new subscriber- me!
http://www.cabiritech.com - cool!!!!
thanks !! very helpful post!