[mailto:[EMAIL PROTECTED] On
Behalf Of robbarreca
Sent: Monday, June 09, 2008 5:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Attaching custom data to events (while
avoiding race condition)
So when I say thread maybe I'm using the wrong terminology. I'm not
actually talking about
[mailto:[EMAIL PROTECTED] On
Behalf Of robbarreca
Sent: Monday, June 09, 2008 5:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Attaching custom data to events (while
avoiding race condition)
So when I say thread maybe I'm using the wrong terminology. I'm not
actually talking
Sorry, I must have not explained well. The race condition I'm talking
about exists here:
thread 1: calls load() and say someFlag gets set to 1;
thread 2: calls load() and someFlag is set to 2;
thread 1: the first load is complete and handleComplete() is called,
but someFlag is set to 2 when the
It makes sense when dealing with concurrent programming, but Flash is single
threaded and you won't have a case where multiple threads are task switching
and simultaneously executing functions. Every function call and event
handler in flex is basically in-lined and will execute to completion.
On
So when I say thread maybe I'm using the wrong terminology. I'm not
actually talking about two different users/browsers. I'm talking about
the same browser running two calls of load().
Let me expand:
function onInitialize() {
loader.addEventListener(handleComplete);
load(1); // Say this
I'd love to know if my explanation made any sense when someone gets a
free moment. If it sounds like I'm smoking crack, please let me know
and I'll check myself into rehab.
Thanks!
-R
--- In flexcoders@yahoogroups.com, robbarreca [EMAIL PROTECTED] wrote:
So when I say thread maybe I'm using
If you need responses to come back in order, don't make the second request
until you've got the first result. Or wait for all responses, and put them
in an array based on some order-information in the AsyncTokens.
-Josh
On Tue, Jun 10, 2008 at 11:48 AM, robbarreca [EMAIL PROTECTED]
wrote:
I think the piece that you were missing is that load is actually pulling
data in from a service, and you can't rely on the order in which the service
responses return.
Josh's answer above is definitely a best practice, if you have multiple
service calls that need to have responses handled in a
8 matches
Mail list logo