diff options
author | UbitUmarov | 2014-08-20 21:41:16 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-20 21:41:16 +0100 |
commit | 88587b4e73b240693bd03172d52c4f13b5f47868 (patch) | |
tree | 3176e93384f3a54e75db977ebdbc72b70735bf12 /OpenSim | |
parent | remove from use the UpdatesResend on resending udp packets. Just resend (diff) | |
download | opensim-SC-88587b4e73b240693bd03172d52c4f13b5f47868.zip opensim-SC-88587b4e73b240693bd03172d52c4f13b5f47868.tar.gz opensim-SC-88587b4e73b240693bd03172d52c4f13b5f47868.tar.bz2 opensim-SC-88587b4e73b240693bd03172d52c4f13b5f47868.tar.xz |
reserve updates priority queue 2 for attachments, send them by it on
BestAvatarResp scheme. Attachments cannot be sent on imediate queues,
since they will block everything. Changed distance to priority math,
keeping identical result, shifted to start at queue 3.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/PriorityQueue.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index e4f1111..d6c39a7 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs | |||
@@ -62,7 +62,9 @@ namespace OpenSim.Framework | |||
62 | private uint m_nextQueue = 0; | 62 | private uint m_nextQueue = 0; |
63 | private uint m_countFromQueue = 0; | 63 | private uint m_countFromQueue = 0; |
64 | // first queues are imediate, so no counts | 64 | // first queues are imediate, so no counts |
65 | private uint[] m_queueCounts = {0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1}; | 65 | // private uint[] m_queueCounts = { 0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1 }; |
66 | private uint[] m_queueCounts = {0, 0, 8, 8, 5, 4, 3, 2, 1, 1, 1, 1}; | ||
67 | // this is ava, ava, attach, <10m, 20,40,80,160m,320,640,1280, + | ||
66 | 68 | ||
67 | // next request is a counter of the number of updates queued, it provides | 69 | // next request is a counter of the number of updates queued, it provides |
68 | // a total ordering on the updates coming through the queue and is more | 70 | // a total ordering on the updates coming through the queue and is more |
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 19d2689..c0405ad 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
175 | { | 175 | { |
176 | // Attachments are high priority, | 176 | // Attachments are high priority, |
177 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) | 177 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) |
178 | return 1; | 178 | return 2; |
179 | 179 | ||
180 | pqueue = ComputeDistancePriority(client, entity, false); | 180 | pqueue = ComputeDistancePriority(client, entity, false); |
181 | 181 | ||
@@ -233,16 +233,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
233 | 233 | ||
234 | // And convert the distance to a priority queue, this computation gives queues | 234 | // And convert the distance to a priority queue, this computation gives queues |
235 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m | 235 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m |
236 | uint pqueue = PriorityQueue.NumberOfImmediateQueues; | 236 | uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue |
237 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; | 237 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; |
238 | 238 | /* | |
239 | for (int i = 0; i < queues - 1; i++) | 239 | for (int i = 0; i < queues - 1; i++) |
240 | { | 240 | { |
241 | if (distance < 30 * Math.Pow(2.0,i)) | 241 | if (distance < 30 * Math.Pow(2.0,i)) |
242 | break; | 242 | break; |
243 | pqueue++; | 243 | pqueue++; |
244 | } | 244 | } |
245 | 245 | */ | |
246 | if (distance > 10f) | ||
247 | { | ||
248 | float tmp = (float)Math.Log((double)distance) * 1.4426950408889634073599246810019f - 3.3219280948873623478703194294894f; | ||
249 | // for a map identical to original: | ||
250 | // now | ||
251 | // 1st constant is 1/(log(2)) (natural log) so we get log2(distance) | ||
252 | // 2st constant makes it be log2(distance/10) | ||
253 | pqueue += (uint)tmp; | ||
254 | if (pqueue > queues - 1) | ||
255 | pqueue = queues - 1; | ||
256 | } | ||
257 | |||
246 | // If this is a root agent, then determine front & back | 258 | // If this is a root agent, then determine front & back |
247 | // Bump up the priority queue (drop the priority) for any objects behind the avatar | 259 | // Bump up the priority queue (drop the priority) for any objects behind the avatar |
248 | if (useFrontBack && ! presence.IsChildAgent) | 260 | if (useFrontBack && ! presence.IsChildAgent) |