aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Main.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-27 00:20:56 +0200
committerMachiavelli <none@none>2010-09-27 00:20:56 +0200
commita9e9a2c8848c22e4a3e3b7bab0caeca25d9ea408 (patch)
treea7c4960796d0a9a42cb1e0252d4a75c4436d1f01 /src/server/authserver/Main.cpp
parent894b2081b3837575bd44c71ea4ebc76008b5b5e3 (diff)
Core/DBLayer:
- DB Threading model update * Get rid of ThreadBundleMask and bundled connection * Implement configurable amount of Synch threads for databasepools * Use modulus based algorithm to check for free synchronous connections instead of previous ¨get connection by thread key or bundlemask¨ feature * Locks on mysql context objects are now managed outside the mysql query methods Fixes issue #4058 Fixes issue #4059 Introduces a ton of more issues. Use at own risk. You were warned. Really. Don´t forget to update your worldserver.conf --HG-- branch : trunk
Diffstat (limited to 'src/server/authserver/Main.cpp')
-rw-r--r--src/server/authserver/Main.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index d23aecf3313..f92949aadc5 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -339,15 +339,22 @@ bool StartDB()
return false;
}
- uint8 num_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1);
- if (num_threads < 1 || num_threads > 32)
+ uint8 worker_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1);
+ if (worker_threads < 1 || worker_threads > 32)
{
sLog.outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
- num_threads = 1;
+ worker_threads = 1;
}
- //- Authserver has singlethreaded synchronous DB access, hence MYSQL_BUNDLE_ALL
- if (!LoginDatabase.Open(dbstring.c_str(), num_threads, MYSQL_BUNDLE_ALL))
+ uint8 synch_threads = sConfig.GetIntDefault("LoginDatabase.SynchThreads", 1);
+ if (synch_threads < 1 || synch_threads > 32)
+ {
+ sLog.outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
+ synch_threads = 1;
+ }
+
+ /// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
+ if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads))
{
sLog.outError("Cannot connect to database");
return false;