From 142008121e2e9c5ca5fca5de07b8a14e37279800 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Mon, 19 Oct 2009 15:19:09 -0700
Subject: * Change Util.FireAndForget to use
ThreadPool.UnsafeQueueUserWorkItem(). This avoids .NET remoting and a
managed->unmanaged->managed jump. Overall, a night and day performance
difference * Initialize the LLClientView prim full update queue to the number
of prims in the scene for a big performance boost * Reordered some
comparisons on hot code paths for a minor speed boost * Removed an
unnecessary call to the expensive DateTime.Now function (if you *have* to get
the current time as opposed to Environment.TickCount, always use
DateTime.UtcNow) * Don't fire the queue empty callback for the Resend
category * Run the outgoing packet handler thread loop for each client
synchronously. It seems like more time was being spent doing the execution
asynchronously, and it made deadlocks very difficult to track down * Rewrote
some expensive math in LandObject.cs * Optimized EntityManager to only lock
on operations that need locking, and use TryGetValue() where possible * Only
update the attachment database when an object is attached or detached * Other
small misc. performance improvements
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 66e1468..74175d0 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Manages authentication for agent circuits
private AgentCircuitManager m_circuitManager;
/// Reference to the scene this UDP server is attached to
- private IScene m_scene;
+ private Scene m_scene;
/// The X/Y coordinates of the scene this UDP server is attached to
private Location m_location;
/// The measured resolution of Environment.TickCount
@@ -184,15 +184,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void AddScene(IScene scene)
{
- if (m_scene == null)
+ if (m_scene != null)
{
- m_scene = scene;
- m_location = new Location(m_scene.RegionInfo.RegionHandle);
+ m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene");
+ return;
}
- else
+
+ if (!(scene is Scene))
{
- m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene");
+ m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType());
+ return;
}
+
+ m_scene = (Scene)scene;
+ m_location = new Location(m_scene.RegionInfo.RegionHandle);
}
public bool HandlesRegion(Location x)
@@ -794,7 +799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
elapsed500MS = 0;
}
- m_scene.ClientManager.ForEach(
+ m_scene.ClientManager.ForEachSync(
delegate(IClientAPI client)
{
if (client is LLClientView)
--
cgit v1.1