diff options
author | Adam Frisby | 2008-08-30 13:38:46 +0000 |
---|---|---|
committer | Adam Frisby | 2008-08-30 13:38:46 +0000 |
commit | 0a5280edb513bc2556da6f784b2abf661133637c (patch) | |
tree | 4cb977395365025fb9e722edf8da2fed3ade6887 /OpenSim/Data/MySQL/MySQLSuperManager.cs | |
parent | * Ditto, UserServer/Main.cs (diff) | |
download | opensim-SC-0a5280edb513bc2556da6f784b2abf661133637c.zip opensim-SC-0a5280edb513bc2556da6f784b2abf661133637c.tar.gz opensim-SC-0a5280edb513bc2556da6f784b2abf661133637c.tar.bz2 opensim-SC-0a5280edb513bc2556da6f784b2abf661133637c.tar.xz |
* Added new "SuperManager" class for MySQL connections, for allowing multiple concurrent MySQL threads.
* Implemented SuperManager inside of UserData. This means the userserver when running on MySQL will use 10 connections (+1 system connection) to handle requests, preventing the previous mire of locking resulting in singlethreadedness.
* This requires testing and grids relying on stability should not upgrade to this revision until it's been properly tested.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLSuperManager.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSuperManager.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSuperManager.cs b/OpenSim/Data/MySQL/MySQLSuperManager.cs new file mode 100644 index 0000000..848a0bd --- /dev/null +++ b/OpenSim/Data/MySQL/MySQLSuperManager.cs | |||
@@ -0,0 +1,27 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Threading; | ||
5 | |||
6 | namespace OpenSim.Data.MySQL | ||
7 | { | ||
8 | class MySQLSuperManager | ||
9 | { | ||
10 | public bool Locked; | ||
11 | private Mutex m_lock; | ||
12 | public MySQLManager Manager; | ||
13 | |||
14 | public void GetLock() | ||
15 | { | ||
16 | Locked = true; | ||
17 | m_lock.WaitOne(); | ||
18 | } | ||
19 | |||
20 | public void Release() | ||
21 | { | ||
22 | m_lock.ReleaseMutex(); | ||
23 | Locked = false; | ||
24 | } | ||
25 | |||
26 | } | ||
27 | } | ||