Flash parallel programming

前端 未结 1 925
醉酒成梦
醉酒成梦 2020-12-10 22:20

Since Flash doesn\'t support thread, how does it manage to deal with multiple animations ? Is it only internally that Flash uses threads but which are not accessible to the

相关标签:
1条回答
  • 2020-12-10 22:34

    Threading is not supported in the actionscript 3 language. However you can achieve a type of pseudo-threading for many common or process-intensive applications. See the following articles for theory + demos and source:

    http://www.senocular.com/flash/tutorials/asyncoperations/

    http://blog.claudiu-ursica.ro/tag/pseudothreads/

    As for weather or not the flash VM is multi-threaded, the answer is, sort-of. Basically everything you do in actionscript 3 is executed in a single thread EXCEPT for pixel bender filters, which are processed in their own thread. Also, for the next major release of flash player, the GPU is exposed so things can/are pushed to the GPU as well so how that factors in, not sure. Anyway below are some references:

    http://en.wikipedia.org/wiki/Tamarin_(JavaScript_engine)

    http://www.mozilla.org/projects/tamarin/faq.html

    Notice in the next link, this person is assigned specifically to a project in development to bring multithreading to the flash VM.

    http://www.adobe.com/technology/people/sanfrancisco/wilkinson.html

    ***Update***

    In regard to my statement about pixel bender running in it's own thread, people use pixel bender for number crunching because of this very reason:

    http://www.adobe.com/devnet/flex/articles/flashbuilder4_pixelbender.html

    Forgot all about it, figured it needed to be added here.

    0 讨论(0)
提交回复
热议问题