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

Reply via email to