aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-07-18 21:28:36 +0100
committerDiva Canto2013-07-21 08:56:48 -0700
commit63c42d66022ea7f1c2805b8f77980af5d4ba1fb4 (patch)
tree48bbe3212636cc81f525ba0d4c6ae56ad27b3551 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-63c42d66022ea7f1c2805b8f77980af5d4ba1fb4.zip
opensim-SC-63c42d66022ea7f1c2805b8f77980af5d4ba1fb4.tar.gz
opensim-SC-63c42d66022ea7f1c2805b8f77980af5d4ba1fb4.tar.bz2
opensim-SC-63c42d66022ea7f1c2805b8f77980af5d4ba1fb4.tar.xz
Do some simple queue empty checks in the main outgoing udp loop instead of always performing these on a separate fired thread.
This appears to improve cpu usage since launching a new thread is more expensive than performing a small amount of inline logic. However, needs testing at scale.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 7229d7c..711a574 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -485,6 +485,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
485 m_udpServer = udpServer; 485 m_udpServer = udpServer;
486 m_udpClient = udpClient; 486 m_udpClient = udpClient;
487 m_udpClient.OnQueueEmpty += HandleQueueEmpty; 487 m_udpClient.OnQueueEmpty += HandleQueueEmpty;
488 m_udpClient.HasUpdates += HandleHasUpdates;
488 m_udpClient.OnPacketStats += PopulateStats; 489 m_udpClient.OnPacketStats += PopulateStats;
489 490
490 m_prioritizer = new Prioritizer(m_scene); 491 m_prioritizer = new Prioritizer(m_scene);
@@ -4133,8 +4134,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4133 4134
4134 void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) 4135 void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories)
4135 { 4136 {
4137// if (!m_udpServer.IsRunningOutbound)
4138// return;
4139
4136 if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) 4140 if ((categories & ThrottleOutPacketTypeFlags.Task) != 0)
4137 { 4141 {
4142// if (!m_udpServer.IsRunningOutbound)
4143// return;
4144
4138 if (m_maxUpdates == 0 || m_LastQueueFill == 0) 4145 if (m_maxUpdates == 0 || m_LastQueueFill == 0)
4139 { 4146 {
4140 m_maxUpdates = m_udpServer.PrimUpdatesPerCallback; 4147 m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
@@ -4160,6 +4167,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4160 ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); 4167 ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
4161 } 4168 }
4162 4169
4170 internal bool HandleHasUpdates(ThrottleOutPacketTypeFlags categories)
4171 {
4172 bool hasUpdates = false;
4173
4174 if ((categories & ThrottleOutPacketTypeFlags.Task) != 0)
4175 {
4176 if (m_entityUpdates.Count > 0)
4177 hasUpdates = true;
4178 else if (m_entityProps.Count > 0)
4179 hasUpdates = true;
4180 }
4181
4182 if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0)
4183 {
4184 if (ImageManager.HasUpdates())
4185 hasUpdates = true;
4186 }
4187
4188 return hasUpdates;
4189 }
4190
4163 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) 4191 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
4164 { 4192 {
4165 AssetUploadCompletePacket newPack = new AssetUploadCompletePacket(); 4193 AssetUploadCompletePacket newPack = new AssetUploadCompletePacket();