From c2f3ff872dd88b4382b41844a4faa632129d1760 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 23 Feb 2009 06:55:42 +0000 Subject: * Performance Changes: * Moves Entity Updates into a seperate thread, allowing for OpenSim to utilize a computers CPU more effectively in return for potentially greater user and prim capacity. * Removes an expensive Sqrt call performed during Update on each object. This should lower CPU requirements for high-prim regions with physics enabled. * MXP Changes: Centers the region around 0,0 for primitives instead of 128,128. Prim display should now look more correct for MXP viewers. --- OpenSim/Region/Framework/Scenes/Scene.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2a3f068..8d81812 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -64,6 +64,8 @@ namespace OpenSim.Region.Framework.Scenes protected Timer m_restartWaitTimer = new Timer(); + protected Thread m_updateEntitiesThread; + public SimStatsReporter StatsReporter; protected List m_regionRestartNotifyList = new List(); @@ -852,7 +854,19 @@ namespace OpenSim.Region.Framework.Scenes otherMS = Environment.TickCount; // run through all entities looking for updates (slow) if (m_frame % m_update_entities == 0) - m_sceneGraph.UpdateEntities(); + { + if (m_updateEntitiesThread == null) + { + m_updateEntitiesThread = new Thread(m_sceneGraph.UpdateEntities); + ThreadTracker.Add(m_updateEntitiesThread); + } + + if(!m_updateEntitiesThread.IsAlive) + m_updateEntitiesThread.Start(); + + //m_sceneGraph.UpdateEntities(); + } + // run through entities that have scheduled themselves for // updates looking for updates(faster) -- cgit v1.1