Threaded Queries - BlueG's MYSQL Plugin R7
#1

Hello everyone,

I've been learning MYSQL since some days now, so i've been reading about threaded and unthreaded queries in BlueG's MYSQL plugin.

In Plugin R7 - We can only use threaded queries. We can not use mysql_query() anymore since it is an unthreaded query.

1. I want to ask - When a query sent to the sqldb is called threaded and unthreaded? if ConnectionHandle is true then it is threaded? Is it the case?

2. I want to ask - Is the function written below contains a threaded query or not? Is the implementation right?

pawn Code:
mysql_function_query(dbHandle, "UPDATE players SET level = 544 WHERE id = 1", false, "", "");
If anyone can let me know these two things then i would appreciate it a lot.

Thank you
Ballu Miaa
Reply
#2

Any query you send in MySQL plugin R7 (and versions beyond) are threaded. This does not mean that every query gets its own thread or something contrary to popular belief, it actually means that the query is executed in a secondary thread.

As soon as the query is finished, the plugin will call amx to execute a callback in any attached script. Whether you specify connection handle or not is highly irrelevant unless you're dealing with many connections. And yes, even then, the queries will be executed in the second thread.

2. That query looks fine to me.
Reply
#3

Quote:
Originally Posted by AndreT
View Post
Any query you send in MySQL plugin R7 (and versions beyond) are threaded. This does not mean that every query gets its own thread or something contrary to popular belief, it actually means that the query is executed in a secondary thread.

As soon as the query is finished, the plugin will call amx to execute a callback in any attached script. Whether you specify connection handle or not is highly irrelevant unless you're dealing with many connections. And yes, even then, the queries will be executed in the second thread.

2. That query looks fine to me.
Oh my Thanks for replying mate. I was reading your thread as well about the Caching. That is new as well as a little confusing for me to get it in one go?

Okay but what exactly does this mean "query is executed in a secondary thread."

I get the concept that threaded queries will keep the server on execution and then calls the samp server again once the query is finished with the result? Is this what actually threaded queries means?

BTW can that query be called as a threaded query?
Reply
#4

If it is confusing then continue reading, perhaps see some scripts released based on it.

Also, that query is already called in the second thread the plugin initiates. And your description of the work scheme of threaded queries is about correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)