Need some explanations - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need some explanations (
/showthread.php?tid=287879)
Need some explanations -
iPLEOMAX - 05.10.2011
Quote:
Originally Posted by Gamer_Z
if you do many calculations on 500 players it will just do the calculations. While it's doing the calculations pawn cannot execute any other functions, so your gamemode will be 'paused' till the operation is done
|
Could you please explain me a bit more why pawn can't execute other functions until the calculations are done?
I'm quite Newbie with this, is it because of it's threading method?
Re: Need some explanations -
Pharrel - 05.10.2011
your computer can do only one operation at a time... so when you do a loop... until the computer is looping he cant do anithing else...
i'm brazilian...i hope u understand
@edit a loop usually takes less then 1 sec but if you do some huge thing in the loop like save 500 accounts... this can take more than seconds to finish
Re: Need some explanations -
Jack_Leslie - 05.10.2011
I guess if you call a function that sends a message to every player online and there's 500 players online and it takes 5 seconds to send it to each player, it's gonna take 500 x 5 seconds, and then if you call another function after 10 seconds, it won't execute.. because the first function hasn't finished. Understand that?
Re: Need some explanations -
iPLEOMAX - 05.10.2011
I assume these are some basic explanations. And Yeah I understand both of them.
Is there anyone else having more detailed ones?
Re: Need some explanations -
Vince - 05.10.2011
Pawn is single threaded, meaning it can only do one thing at a time. Execute a function, then sync the players, the execute another function and sync the players again ... It can't execute a function
while it's syncing, for example.