31.01.2011, 16:55
A great tutorial for scripters about SA-MP sync, I've learnd some more about sa-mp sync from it.^^
But there're few arguments in this thread, still.
Personally, I don't agree the topic.
It is the code runtime(bytecode?) that runs on a single thread, but data such as network process(player-position, dialog, text, etc) not.
Assume it has a priority list.
Particularly, sa-mp build-in sqLite and most of mySQL plugins do process while sa-mp code runtime, on the contrary of simple File input/output.
Now we can explain why dialog shows delayed half-seconds when typing a command to show a specfic dialog, and during the short period the player can play as usual.
So I prefer "Your sa-mp code runs on a singlee thread" than "The server runs on a single thread" for this topic.
It is the client-server data exchange paused/unpaused.
But there're few arguments in this thread, still.
Quote:
The server runs on a single thread The server runs on a single thread. This might sound complicated for some people, allow me to explain: All the actions the server does are always after waiting for the latest action to finish. For example, if you have code that takes 3 seconds to run in OnPlayerConnect (such as the old GeoIP plugin), then the server will wait for that code to finish before doing anything else. |
It is the code runtime(bytecode?) that runs on a single thread, but data such as network process(player-position, dialog, text, etc) not.
Assume it has a priority list.
Code:
1 - gtasa ingame action(position, aimming, shooting, etc) 2 - sa-mp info(scores, text, dialog, etc) 3 - plugin data
Now we can explain why dialog shows delayed half-seconds when typing a command to show a specfic dialog, and during the short period the player can play as usual.
So I prefer "Your sa-mp code runs on a singlee thread" than "The server runs on a single thread" for this topic.
Quote:
The client is currently paused so the message is put in a pool and will be handled once the player is unpaused and all the messages in the pool before it was handled. |