Re: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
slangeberg wrote: Hey everyone, I know there exists an article/whitepaper from Adobe outlining the new AS3 VM2(?), but I can't find it. Anyone know where that is? I think it would be helpful for this gentleman's situation. A good place to start would be the Adobe Component Developer Summit slides that Ted Patrick put up on his blog last summer: http://www.onflex.org/ted/2006/07/adobe-component-developer-summit.php Altogether, it's a fairly thorough overview of the Flex framework architecture, and includes a presentation by Gary Grossman on some of the virtual machine internals and how these relate to performance on the scripting side of things. As to the VM itself, the C++ source code to Adobe's ActionScript 3 VM was released last fall to the community as open-source under the Mozilla triple license. It's been christened Tamarin and is now part of the Mozilla codebase. There's quite a bit of material about it to be found on the project site at: http://www.mozilla.org/projects/tamarin/ The sources include, among other things, the virtual machine proper, just-in-time compilers for dynamically recompiling the AVM bytecode to native machine code for PowerPC, Intel and ARM processors, and the new garbage collection implementation. Note however, that it does not come with a compiler for compiling ActionScript 3 into bytecode. For that, you'll still need to use the free ones from the Flex SDK or a third-party compiler. Jim Cheng effectiveUI
Re: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
On Thursday 22 Feb 2007, Ralf Bokelberg wrote: Hi Ravi It sounds, like you have a rather good understanding of what is going on. When we talk about the VM, we have to talk about Flash. Flash is framebased like a movie. As a Flex developer, 99.% of the time, this does not matter to you one iota. You can ignore it and just dive stright in and tie some JSPs to a DataGrid or whatever. -- Tom Chiverton Helping to preemptively empower distributed customers at http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. Yahoo! Groups Sponsor ~-- Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/kOt0.A/gOaOAA/yQLSAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups - Join or create groups, clubs, forums amp; communities. Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups - Join or create groups, clubs, forums amp; communities. is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
Hi, I am basically a Java guy, recently into Flex. It may be due to the sudden paradigm shift from serial programming ( incl Threads) to Event Based Programming, that I find many features totally new and surprising. I read in a article that Flash/Flex is based on AMPED (Asymmetric-Multi Process Event Driven) Architecture. In this kind of architecture , We have a single thread dispatching the events and the control gets transferred between the Events and the main thread. ( These are my vague conclusions from what I have read and understood, Correct me if I am wrong! ) So if the event dispatched doesn't have a IO/Network operation, the control reaches back to the EventDispatcher only after the eventhandler method is totally complete. But if our eventhandling mechanism has a huge data crunching operation , doesn't that freeze the client? 1. Lets say I have 2 things to be done, Doing a animation and some huge data operation simultaneously! In Java, what we usually do is spawn a new thread for doing the animation (or) doing the data operation! This takes care of the scenario. Now in Flex, We dispatch events, Lets say, OperateDataEvent and AnimateEvent, both of them have some handlers (ODEHandler, AEHandler respectively). Now when we do something like this, dispatchEvent(new OperateDataEvent()) and dispatchEvent(new AnimateEvent()) How does the control flow?? Does this fully complete the DataOperationEvent first and then return to animateEvent ! Since its a single thread model, I guess it should be done so! But then it doesnt sound logical for any matured programming languge to cripple an application from doing another task and make it wait. 2. Second thing is, How does the Timer/setInterval actually function in the Flex architecture, Is it a separate 'thread' ( Oops!this Java hangover is not gonna leave me ! ) Is it advisable to have big operations inside the timerHandler which may result in periodic glitches in the application. 3 Can anyone give a good resource of the AVM structure and design and how it differs from JVM! Thanks in advance Cheers, Ravi Kumar G PartyGaming Plc. www.partygaming.com What is right is right, even if no one is doing it. What is wrong is wrong, even if everyone is doing it. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news
RE: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
Threading is one of the major missing features in Flex/Flash Player. Basically, the player is multi-threaded and some operations will happen asynchronously but ActionScript code always executes on the same thread. For example, when you make a HTTPService call the network code itself will run on a separate thread, but your call and the event handler for the callback run on the same thread. If you do a lot of processing that takes more than a frame then the frame rate will decrease and perceived performance will suffer. To combat this use the built-in functionality which is multithreaded as much as possible and when appropriate offload processing work to the server. When you have to do heavy processing on the client one solution is to break up the work into separate chunks and then use a frame-based loop to process the chunks until it's done. One problem is it's hard to know how much processing to do in each frame because there's no way to know how much time has already elapsed in the current frame before your code started or how much other work is going to be done before the frame is complete. HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team building Flex based products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ravi kumar gummadi Sent: Thursday, February 22, 2007 1:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! ) Hi, I am basically a Java guy, recently into Flex. It may be due to the sudden paradigm shift from serial programming ( incl Threads) to Event Based Programming, that I find many features totally new and surprising.
Re: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
Hey everyone, I know there exists an article/whitepaper from Adobe outlining the new AS3 VM2(?), but I can't find it. Anyone know where that is? I think it would be helpful for this gentleman's situation. Thanks, -Scott On 2/22/07, ravi kumar gummadi [EMAIL PROTECTED] wrote: Hi, I am basically a Java guy, recently into Flex. It may be due to the sudden paradigm shift from serial programming ( incl Threads) to Event Based Programming, that I find many features totally new and surprising. I read in a article that Flash/Flex is based on AMPED (Asymmetric-Multi Process Event Driven) Architecture. In this kind of architecture , We have a single thread dispatching the events and the control gets transferred between the Events and the main thread. ( These are my vague conclusions from what I have read and understood, Correct me if I am wrong! ) So if the event dispatched doesn't have a IO/Network operation, the control reaches back to the EventDispatcher only after the eventhandler method is totally complete. But if our eventhandling mechanism has a huge data crunching operation , doesn't that freeze the client? 1. Lets say I have 2 things to be done, Doing a animation and some huge data operation simultaneously! In Java, what we usually do is spawn a new thread for doing the animation (or) doing the data operation! This takes care of the scenario. Now in Flex, We dispatch events, Lets say, OperateDataEvent and AnimateEvent, both of them have some handlers (ODEHandler, AEHandler respectively). Now when we do something like this, dispatchEvent(new OperateDataEvent()) and dispatchEvent(new AnimateEvent()) How does the control flow?? Does this fully complete the DataOperationEvent first and then return to animateEvent ! Since its a single thread model, I guess it should be done so! But then it doesnt sound logical for any matured programming languge to cripple an application from doing another task and make it wait. 2. Second thing is, How does the Timer/setInterval actually function in the Flex architecture, Is it a separate 'thread' ( Oops!this Java hangover is not gonna leave me ! ) Is it advisable to have big operations inside the timerHandler which may result in periodic glitches in the application. 3 Can anyone give a good resource of the AVM structure and design and how it differs from JVM! Thanks in advance Cheers, Ravi Kumar G PartyGaming Plc. www.partygaming.com What is right is right, even if no one is doing it. What is wrong is wrong, even if everyone is doing it. -- Never miss an email again! Yahoo! Toolbarhttp://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/alerts you the instant new Mail arrives.Check it out. -- : : ) Scott
Re: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
Ok, here it is. Right on my desktop, wouldn't you know!: (not it, but worth looking) http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html (this is it!) http://www.onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf =Scott On 2/22/07, slangeberg [EMAIL PROTECTED] wrote: Hey everyone, I know there exists an article/whitepaper from Adobe outlining the new AS3 VM2(?), but I can't find it. Anyone know where that is? I think it would be helpful for this gentleman's situation. Thanks, -Scott On 2/22/07, ravi kumar gummadi [EMAIL PROTECTED] wrote: Hi, I am basically a Java guy, recently into Flex. It may be due to the sudden paradigm shift from serial programming ( incl Threads) to Event Based Programming, that I find many features totally new and surprising. I read in a article that Flash/Flex is based on AMPED (Asymmetric-Multi Process Event Driven) Architecture. In this kind of architecture , We have a single thread dispatching the events and the control gets transferred between the Events and the main thread. ( These are my vague conclusions from what I have read and understood, Correct me if I am wrong! ) So if the event dispatched doesn't have a IO/Network operation, the control reaches back to the EventDispatcher only after the eventhandler method is totally complete. But if our eventhandling mechanism has a huge data crunching operation , doesn't that freeze the client? 1. Lets say I have 2 things to be done, Doing a animation and some huge data operation simultaneously! In Java, what we usually do is spawn a new thread for doing the animation (or) doing the data operation! This takes care of the scenario. Now in Flex, We dispatch events, Lets say, OperateDataEvent and AnimateEvent, both of them have some handlers (ODEHandler, AEHandler respectively). Now when we do something like this, dispatchEvent(new OperateDataEvent()) and dispatchEvent(new AnimateEvent()) How does the control flow?? Does this fully complete the DataOperationEvent first and then return to animateEvent ! Since its a single thread model, I guess it should be done so! But then it doesnt sound logical for any matured programming languge to cripple an application from doing another task and make it wait. 2. Second thing is, How does the Timer/setInterval actually function in the Flex architecture, Is it a separate 'thread' ( Oops!this Java hangover is not gonna leave me ! ) Is it advisable to have big operations inside the timerHandler which may result in periodic glitches in the application. 3 Can anyone give a good resource of the AVM structure and design and how it differs from JVM! Thanks in advance Cheers, Ravi Kumar G PartyGaming Plc. www.partygaming.com What is right is right, even if no one is doing it. What is wrong is wrong, even if everyone is doing it. -- Never miss an email again! Yahoo! Toolbar http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/alerts you the instant new Mail arrives.Check it out. -- : : ) Scott -- : : ) Scott
Re: [flexcoders] Java to Flex shifting ! Major Hurdles!!! (Shud I say Roadblocks! )
Hi Ravi It sounds, like you have a rather good understanding of what is going on. When we talk about the VM, we have to talk about Flash. Flash is framebased like a movie. In every frame all the scripts of all movieclips are executed, then all the system events are handled, be it load, timer, key or mouse events, and finally, the screen is updated. This loop is repeated all the time. And yes, no script is ever interrupted, so big operations block your whole system. If you want to execute huge operations without blocking, you have to split this operation up into multiple parts and use a timer to execute the parts of this operation one by one. Personally, i wouldn't want to introduce such a complicated and much disputed low level mechanism as threads intro the flash/flex programming model. Cheers Ralf. On 2/22/07, ravi kumar gummadi [EMAIL PROTECTED] wrote: Hi, I am basically a Java guy, recently into Flex. It may be due to the sudden paradigm shift from serial programming ( incl Threads) to Event Based Programming, that I find many features totally new and surprising. I read in a article that Flash/Flex is based on AMPED (Asymmetric-Multi Process Event Driven) Architecture. In this kind of architecture , We have a single thread dispatching the events and the control gets transferred between the Events and the main thread. ( These are my vague conclusions from what I have read and understood, Correct me if I am wrong! ) So if the event dispatched doesn't have a IO/Network operation, the control reaches back to the EventDispatcher only after the eventhandler method is totally complete. But if our eventhandling mechanism has a huge data crunching operation , doesn't that freeze the client? 1. Lets say I have 2 things to be done, Doing a animation and some huge data operation simultaneously! In Java, what we usually do is spawn a new thread for doing the animation (or) doing the data operation! This takes care of the scenario. Now in Flex, We dispatch events, Lets say, OperateDataEvent and AnimateEvent, both of them have some handlers (ODEHandler, AEHandler respectively). Now when we do something like this, dispatchEvent(new OperateDataEvent()) and dispatchEvent(new AnimateEvent()) How does the control flow?? Does this fully complete the DataOperationEvent first and then return to animateEvent ! Since its a single thread model, I guess it should be done so! But then it doesnt sound logical for any matured programming languge to cripple an application from doing another task and make it wait. 2. Second thing is, How does the Timer/setInterval actually function in the Flex architecture, Is it a separate 'thread' ( Oops!this Java hangover is not gonna leave me ! ) Is it advisable to have big operations inside the timerHandler which may result in periodic glitches in the application. 3 Can anyone give a good resource of the AVM structure and design and how it differs from JVM! Thanks in advance Cheers, Ravi Kumar G PartyGaming Plc. www.partygaming.com What is right is right, even if no one is doing it. What is wrong is wrong, even if everyone is doing it. -- Never miss an email again! Yahoo! Toolbarhttp://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/alerts you the instant new Mail arrives.Check it out. -- Ralf Bokelberg [EMAIL PROTECTED] Flex Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35