You may want to wait for a confirmation from Adobe, but this is my understanding too...
By implementation Flash Player has a number of thread behind the scene, but execution of VM code is expected to be single-threaded.
There are talks about adding multithreading in future versions of Flash Player, though indirectly via some kind of wrappers for simpler synchronization.
If there are two different HTTPService calls like below
And if service1's response is heavy than service2 i.e. server will take more time to process service1 request. Will the above described scenario work ?
Or the above scenariois only for one HTTPService call. Like below
In this case also I am not sure if you can say this is gauranted. As it is server side response dependent.
Though I am not sure fully. Thanks !!
What is guaranteed is that one result handler will run to completion before
the other one. The order that the handlers will run is not guaranteed.
@"Flex harUI" : I believe the order of the handlers is guaranteed. It depends on their priority, which in the default case depends on which order they were added.
@ the OP : Yes, the any given handler will run to completion before the next handler starts, since you have just one thread. It is important to distinguish beteween the Adobe product itself (multi-threaded) and your flash code that you are running (always single threaded). To fully understand what will happen with your event handlers you need to read up on Event Flow. Additionally, the entire Event Flow is determined prior to the first handler being triggered. If a handler is in the flow then it will be triggered even if an earlier handler removes the object from the display.
Why would the order of response to two asynchronous calls be guaranteed?
Sorry, you're right. I was confusing the complettion of the http response with the initiation and completion of the actual event handlers. (Note to self: re-read stuff before posting). As you said, yes, the http responses can arrive in any order, but once the event handler is running that bit has to complete before the other handler can start.