From a8246bc57ea6735965b48625b092a63663c4560b Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 30 Jul 2009 06:27:45 +0000 Subject: * Remove and comment out old and unneeded parts of the old TextureDownload and UserTextureDownloadService modules. * These have been mostly replaced by the PriorityQueue sender in LLClientView (it was still using threads and poll processing!) * Thread Reduction! * Might have been sending more image packets then necessary previously, texture times 2. We'll see if this reduces the texture packet load. --- .../Agent/TextureDownload/TextureDownloadModule.cs | 13 ++-- .../TextureDownload/UserTextureDownloadService.cs | 74 ++++++++++------------ 2 files changed, 39 insertions(+), 48 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 0d95f15..fa5369f 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -60,8 +60,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload private Scene m_scene; private List m_scenes = new List(); - private Thread m_thread; - public TextureDownloadModule() { } @@ -70,15 +68,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) { //m_log.Debug("Creating Texture download module"); m_scene = scene; - m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); - m_thread.Name = "ProcessTextureSenderThread"; - m_thread.IsBackground = true; - m_thread.Start(); - ThreadTracker.Add(m_thread); + //m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); + //m_thread.Name = "ProcessTextureSenderThread"; + //m_thread.IsBackground = true; + //m_thread.Start(); + //ThreadTracker.Add(m_thread); } if (!m_scenes.Contains(scene)) diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs index b333f73..5be2a65 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -106,67 +106,57 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload /// public void HandleTextureRequest(TextureRequestArgs e) { - TextureSender.TextureSender textureSender; + + //TextureSender.TextureSender textureSender; //TODO: should be working out the data size/ number of packets to be sent for each discard level - if ((e.DiscardLevel >= 0) || (e.Priority != 0)) - { - lock (m_textureSenders) - { - if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) - { + //if ((e.DiscardLevel >= 0) || (e.Priority != 0)) + //{ + //lock (m_textureSenders) + //{ + //if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) + //{ // If we've received new non UUID information for this request and it hasn't dispatched // yet, then update the request accordingly. - textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); - } - else - { + // textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); + //} + //else + //{ // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); - if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) - { + //if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) + //{ // m_log.DebugFormat( // "[TEXTURE]: Refusing request for {0} from client {1}", // e.RequestedAssetID, m_client.AgentId); - return; - } - else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) - { - if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) - { - if (StatsManager.SimExtraStats != null) - StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); + //return; + //} + //else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) + //{ + // if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) + // { + // if (StatsManager.SimExtraStats != null) + // StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); // Commenting out this message for now as it causes too much noise with other // debug messages. // m_log.DebugFormat( // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); - } + // } - return; - } + // return; + //} - m_scene.StatsReporter.AddPendingDownloads(1); + m_scene.StatsReporter.AddPendingDownloads(1); - TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); - m_textureSenders.Add(e.RequestedAssetID, requestHandler); + //TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); + //m_textureSenders.Add(e.RequestedAssetID, null); - m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived); - } - } - } - else - { - lock (m_textureSenders) - { - if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) - { - textureSender.Cancel = true; - } - } - } + m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived); + + } protected void TextureReceived(string id, Object sender, AssetBase asset) @@ -189,6 +179,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload if (closed) return; + /* lock (m_textureSenders) { TextureSender.TextureSender textureSender; @@ -233,6 +224,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload textureID); } } + */ } /// -- cgit v1.1