Flash Player Feature Request - Continuation Support (Practical Threading)
DIGG IT!
0
Comments
Published
Wednesday, October 29, 2003
at
8:46 AM
.
Continuations are a simple threading model that is supported in several stack based systems. So what exactly are continuations? And how should Flash support them?\0
Continuations are special functions that never return to the stack and allow the stack to continue processing. The execution of a continuation is thus parallel to the operation of the stack. Continuations run until they complete. Most often they execute another continuation or call themselves recursively. When execution reaches the end of a continuation, the execution ends and all resources are returned / garbage collected.
In most stack based systems (Flash, Python, Java), when you call a function, stack processing moves to processing the function and returns to the next instruction after the function is executed. This forces the stack to always work under a single thread and never allows the system to process 'N' items in parallel.
Example of continuation support for ActionScript:
myContinuation = continuation(){
trace('myContinuation Executing')
//if data is true call the continuation again
if (mydata ==1){ arguments.callee() }
//if this point is reached kill the continuation
}
mydata = 1
myContinuation()
trace('hello')
mydata = 0
trace('end')
Output:
myContinuation Executing
hello
myContinuation Executing
end
Output without continuation support:
myContinuation Executing
256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie.
This would add a simple light parallel execution model to the Flash Player providing a solution to a entire host of problems:
1. Parallel instantiation - Shorten the delay in instantiating components, frameworks, etc.
2. Parallel execution of event listeners - All events would be processed at close to the same time frame, vs. sequentially.
3. Parallel events execution - Allowing player events to be processed at once independently.
4. Process XML in parallel
5. {Your reason here}
A system independent threading model is just what the Flash Player needs to escape the performance related problems of the current architecture. Even with the enhancements in v7 of the player, the V2 component model takes the player to the performance limit. This is a direct result of Flash being a stack based system without support for parallel processing.
To support this initiative please do the following:
1. Sign the comments showing your approval for Macromedia to develop this feature
2. Send this request in parallel to Macromedia Wish Form
Comments and suggestions are always welcome.
Thanks,
Ted Patrick
PowerSDK Software Corp.

0 Responses to “ Flash Player Feature Request - Continuation Support (Practical Threading) ”
Post a Comment