aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-14 11:43:31 -0700
committerJohn Hurliman2009-10-14 11:43:31 -0700
commit0d2e6463d714bce8a6a628bd647c625feeeae8f6 (patch)
tree1d4a805e65932c225a4c6a2b219b23840b3288a9 /OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
parent* Split Task category into Task and State (diff)
downloadopensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.zip
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.gz
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.bz2
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.xz
* Minimized the number of times textures are pulled off the priority queue
* OnQueueEmpty is still called async, but will not be called for a given category if the previous callback for that category is still running. This is the most balanced behavior I could find, and seems to work well * Added support for the old [ClientStack.LindenUDP] settings (including setting the receive buffer size) and added the new token bucket and global throttle settings * Added the AssetLoaderEnabled config variable to optionally disable loading assets from XML every startup. This gives a dramatic improvement in startup times for those who don't need the functionality every startup
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs48
1 files changed, 25 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 8410ee9..9d36cff 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -162,32 +162,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
162 } 162 }
163 } 163 }
164 164
165 public bool ProcessImageQueue(int count, int maxpack) 165 public bool ProcessImageQueue(int packetsToSend)
166 { 166 {
167 J2KImage imagereq;
168 int numCollected = 0;
169
170 m_lastloopprocessed = DateTime.Now.Ticks; 167 m_lastloopprocessed = DateTime.Now.Ticks;
168 int packetsSent = 0;
171 169
172 // This can happen during Close() 170 while (packetsSent < packetsToSend)
173 if (m_client == null)
174 return false;
175
176 while ((imagereq = GetHighestPriorityImage()) != null)
177 { 171 {
178 if (imagereq.IsDecoded == true) 172 J2KImage image = GetHighestPriorityImage();
173
174 // If null was returned, the texture priority queue is currently empty
175 if (image == null)
176 return false;
177
178 if (image.IsDecoded)
179 { 179 {
180 ++numCollected; 180 int sent;
181 bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent);
181 182
182 if (imagereq.SendPackets(m_client, maxpack)) 183 packetsSent += sent;
183 {
184 // Send complete. Destroy any knowledge of this transfer
185 RemoveImageFromQueue(imagereq);
186 }
187 }
188 184
189 if (numCollected == count) 185 // If the send is complete, destroy any knowledge of this transfer
190 break; 186 if (imageDone)
187 RemoveImageFromQueue(image);
188 }
189 else
190 {
191 // TODO: This is a limitation of how LLImageManager is currently
192 // written. Undecoded textures should not be going into the priority
193 // queue, because a high priority undecoded texture will clog up the
194 // pipeline for a client
195 return true;
196 }
191 } 197 }
192 198
193 return m_priorityQueue.Count > 0; 199 return m_priorityQueue.Count > 0;
@@ -199,10 +205,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
199 public void Close() 205 public void Close()
200 { 206 {
201 m_shuttingdown = true; 207 m_shuttingdown = true;
202 m_priorityQueue = null;
203 m_j2kDecodeModule = null;
204 m_assetCache = null;
205 m_client = null;
206 } 208 }
207 209
208 #region Priority Queue Helpers 210 #region Priority Queue Helpers