Some Questions aBout Threaded Queries
#1

What is Threaded Queries?
And What does it do?
How to Do it?
Reply
#2

Threaded queries are queries that respond quickly which means they are fast, and are used for loading or saving data in MySQL, just like a normal query. Here is a tutorial on how to make a script with MySQL threaded queries.

https://sampforum.blast.hk/showthread.php?tid=574714
Reply
#3

Quote:
Originally Posted by Jacket
View Post
Threaded queries are queries that respond quickly which means they are fast, and are used for loading or saving data in MySQL, just like a normal query. Here is a tutorial on how to make a script with MySQL threaded queries.

https://sampforum.blast.hk/showthread.php?tid=574714
thx but , he Didn't Say exactly Whats The Thing that Makes your System Threaded,
is it that Accountcheck Forwards and else?
Reply
#4

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.
Reply
#5

Quote:
Originally Posted by !damo!spiderman
View Post
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.
Well Explained! Thanks!
But , can you asnwer my question please
That Accountcheck and Register Forwards And Stocks are the ones That Makes the Threaded Queries on my script?
Reply
#6

Those functions are the ones that get called after the query is finished.

mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);

That function there is the threaded query function. You can see that it calls OnAccountCheck after the query has finished.
Reply
#7

Thanks,
Another question,
is MellAdmin System using Threaded Queries?
I Noticed it does use this
#define _THREAD_LOAD_PLAYER (0)
#define _THREAD_SAVE_PLAYER (1)
#define _THREAD_CREATE_PLAYER (2)
#define _THREAD_ACCOUNT_EXIST (3)
#define _FETCH_PLAYER_INFO (4)
#define _FETCH_BAN_STAT (5)
#define _UPDATE_PLAYER_PW (6)
#define _THREAD_IS_BANNED (7)
#define _CHECK_PASSWORD (
#define _THREAD_BAN_USER (9)
#define _CHECK_AUTO_LOGIN (10)
#define _THREAD_PLAYER_LOGIN (11)
#define _THREAD_PLAYER_LOGOUT (12)
Reply
#8

It looks that way as they use the MySQL plugin and having defines like that seem to point to that but I can't be sure as the filterscript has been depreciated and the source code removed due to security issues.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)