Quote:

The global var will keep its value untill an instruction is executed where other events can be processed.




Hmmm... I'm pretty sure that since this is a global variable and it's being used on the network, that this is not the case.

Consider that dosomething takes 10 seconds to execute (just for the sake of arguement). During second 5, the application received another var. Were is that var stored? How does tha application KNOW not to overwrite it because another function is using it? Is the new event placed on hold while the old event finishes? I think the answers are the var is stored in the same variable, the application doesn't know that this var is being used in a event function (it's global after all), and the application can't wait for the old event to finish or it wouldn't be an "event". I could be wrong on some or all of these ponts, but since this is a global variable, there is only one, and the application has no idea to "stack" the incoming variables because it's being used, I don't see how it could be otherwise. It would be radically different if the variable were local to the event. In this case, each event would create a new variable onto which to store the value coming in and then it would work as you want, with each new event not interfering with anothers value. This is the way I see events and variables...

Quote:

what happens, if a new event occurs before you copied the global var to the local ??




As to what happens as if you get an event while you are copying, that is, in my mind an impossibility. Once the event is triggered, if the first thing you do is copy it to another variable, the new event would have to "sneak in" during the .0001 ms that it takes to copy from one variable to another. I don't know that events are based on framerate or independent of it, but the time it takes to copy a variable from on to another is so short, it's hard to believe that you will ever run into a situation where you have a new, incoming copy ursurping the ongoing, old copy.

(PS: If anyone is willng, a simple test program would solve this issue: create a server that prints out the value of a var from dosomething() every time it's triggered. Have dosomething() do something that takes some time (but no wait)... some long calculation using the var perhaps. Have the client rapid fire changing vars in a predictable pattern. Then compare the diag() output with what you sent. If it's as I say, you should see divergence of results as new vars are overwritten mid-calculation in dosomething(). If it's as you say, the calculations will remain the same on client and server regardless of the speed that you send the vars down)