aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-21 21:22:56 +0000
committerTeravus Ovares2008-05-21 21:22:56 +0000
commit5af108a029e5382f6a2f6d4d10b3d4de3a8f5245 (patch)
tree171813c4182af2849052281c1e941dec434e6815 /OpenSim/Region/Environment/Scenes/Scene.cs
parentimplement in memory appearance cache for sqlite. This (diff)
downloadopensim-SC-5af108a029e5382f6a2f6d4d10b3d4de3a8f5245.zip
opensim-SC-5af108a029e5382f6a2f6d4d10b3d4de3a8f5245.tar.gz
opensim-SC-5af108a029e5382f6a2f6d4d10b3d4de3a8f5245.tar.bz2
opensim-SC-5af108a029e5382f6a2f6d4d10b3d4de3a8f5245.tar.xz
* This update causes the backup process to run in a separate thread.
* Concurrency issues are resolved because each object makes a memory-only copy of itself and backs up the copy. * Because of the way this is done, the latest at the time of the backup gets backed up (no functionality change) * You can move *thousands of objects at a time* and the sim doesn't freeze and wait for the backup to complete. * This can be enhanced more by dedicating the thread as opposed to starting it when the backup process starts.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 56d114c..280e09a 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Region.Environment.Scenes
58 public SynchronizeSceneHandler SynchronizeScene = null; 58 public SynchronizeSceneHandler SynchronizeScene = null;
59 public int splitID = 0; 59 public int splitID = 0;
60 60
61
61 #region Fields 62 #region Fields
62 63
63 protected Timer m_heartbeatTimer = new Timer(); 64 protected Timer m_heartbeatTimer = new Timer();
@@ -83,6 +84,7 @@ namespace OpenSim.Region.Environment.Scenes
83 private int m_RestartTimerCounter; 84 private int m_RestartTimerCounter;
84 private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing 85 private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing
85 private int m_incrementsof15seconds = 0; 86 private int m_incrementsof15seconds = 0;
87 private bool m_backingup = false;
86 88
87 public string m_simulatorVersion = "OpenSimulator 0.5"; 89 public string m_simulatorVersion = "OpenSimulator 0.5";
88 90
@@ -842,7 +844,14 @@ namespace OpenSim.Region.Environment.Scenes
842 844
843 private void UpdateStorageBackup() 845 private void UpdateStorageBackup()
844 { 846 {
845 Backup(); 847 if (!m_backingup)
848 {
849 m_backingup = true;
850 Thread backupthread = new Thread(Backup);
851 backupthread.Name = "BackupWriter";
852 backupthread.IsBackground = true;
853 backupthread.Start();
854 }
846 } 855 }
847 856
848 private void UpdateEvents() 857 private void UpdateEvents()
@@ -863,10 +872,11 @@ namespace OpenSim.Region.Environment.Scenes
863 /// 872 ///
864 /// </summary> 873 /// </summary>
865 /// <returns></returns> 874 /// <returns></returns>
866 public bool Backup() 875 public void Backup()
867 { 876 {
868 EventManager.TriggerOnBackup(m_storageManager.DataStore); 877 EventManager.TriggerOnBackup(m_storageManager.DataStore);
869 return true; 878 m_backingup = false;
879 //return true;
870 } 880 }
871 881
872 #endregion 882 #endregion