SA-MP Forums Archive
Calling Threaded Queries - 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: Calling Threaded Queries (/showthread.php?tid=605883)



Calling Threaded Queries - Eyce - 26.04.2016

Is there a way to call a single threaded query separately? If so, how? I tried to look for answers but to no avail. Another thing is, I saw this post somewhere.

Quote:
Originally Posted by !damo!spiderman
Посмотреть сообщение
Threaded queries run on a separate thread in the background. Basically SA-MP server is a single threaded program by default, which means any functions you run have to wait in turn to get executed. What the mysql plugin does is it allows you to run a query on a separate thread, so it means that if your query takes too long it's not going to block the main thread causing it to freeze and lag, instead it will execute the query in the background and then notify that it is done via a callback.
I'm using threaded queries and tried to save everything every hour, but it causes lag, is that normal?


Re: Calling Threaded Queries - BloodyRP - 26.04.2016

Quote:
Originally Posted by Eyce
Посмотреть сообщение
Is there a way to call a single threaded query separately? If so, how? I tried to look for answers but to no avail. Another thing is, I saw this post somewhere.



I'm using threaded queries and tried to save everything every hour, but it causes lag, is that normal?
if u have mysql_log(LOG_ALL); disable that