Flash 并行编程 [英] Flash parallel programming
问题描述
由于 Flash 不支持线程,它如何处理多个动画?Flash 仅在内部使用线程而程序员无法访问这些线程吗?
原则上如何在闪存中实现并行任务,如此处所述: 解决方案
在 actionscript 3 语言中不支持线程.但是,您可以为许多常见或进程密集型应用程序实现一种类型的伪线程.有关理论 + 演示和来源,请参阅以下文章:
http://www.sencular.com/flash/tutorials/asyncoperations/
http://blog.claudiu-ursica.ro/tag/pseudothreads/
至于天气与否,闪存 VM 是否是多线程的,答案是,有点.基本上你在 actionscript 3 中所做的一切都是在单个线程中执行的,除了像素弯曲过滤器,它们在它们自己的线程中处理.此外,对于 Flash 播放器的下一个主要版本,GPU 是公开的,所以事情也可以/被推到 GPU 上,所以不确定是如何影响的.无论如何,下面是一些参考:
http://en.wikipedia.org/wiki/Tamarin_(JavaScript_engine)
http://www.mozilla.org/projects/tamarin/faq.html>
请注意,在下一个链接中,此人被专门分配给一个正在开发的项目,以将多线程引入闪存 VM.
http://www.adobe.com/technology/people/sanfrancisco/wilkinson.html一个>
***更新***
关于我关于像素弯曲器在它自己的线程中运行的声明,人们使用像素弯曲器进行数字运算就是因为这个原因:
http://www.adobe.com/devnet/flex/articles/flashbuilder4_pixelbender.html一个>
忘记了,觉得有必要加在这里.
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 programmer ?
How on the principle can you implement parallel tasks in flash like what's described here: http://books.google.fr/books?id=1OJ8EhvuPXAC&pg=PA352&lpg=PA352&dq=FLASH+PARALLEL+TASK&source=bl&ots=iTQIolYXCy&sig=edGCy1YYAZYJfxAMhrfUBkiggwo&hl=en&ei=94WgTfGWCMmxhAfgkNGQBQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBQQ6AEwAA#v=onepage&q=FLASH%20PARALLEL%20TASK&f=false
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.
这篇关于Flash 并行编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!