diff options
author | UbitUmarov | 2017-07-10 22:01:38 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-10 22:01:38 +0100 |
commit | 40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1 (patch) | |
tree | 1c9c9073397754a671fb2a4547394177b756b6db | |
parent | a few more changes on entities updates (diff) | |
download | opensim-SC_OLD-40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1.zip opensim-SC_OLD-40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1.tar.gz opensim-SC_OLD-40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1.tar.bz2 opensim-SC_OLD-40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1.tar.xz |
SimpleAngularDistance update prioritization scheme ameks no sense without ordered dequeue of the updates
-rw-r--r-- | OpenSim/Framework/PriorityQueue.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 30 |
2 files changed, 47 insertions, 4 deletions
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index 5b9185e..22ffcdc 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs | |||
@@ -216,6 +216,27 @@ namespace OpenSim.Framework | |||
216 | return false; | 216 | return false; |
217 | } | 217 | } |
218 | 218 | ||
219 | public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue) | ||
220 | { | ||
221 | // If there is anything in imediate queues, return it first no | ||
222 | // matter what else. Breaks fairness. But very useful. | ||
223 | for (int iq = 0; iq < NumberOfQueues; iq++) | ||
224 | { | ||
225 | if (m_heaps[iq].Count > 0) | ||
226 | { | ||
227 | MinHeapItem item = m_heaps[iq].RemoveMin(); | ||
228 | m_lookupTable.Remove(item.Value.Entity.LocalId); | ||
229 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); | ||
230 | value = item.Value; | ||
231 | return true; | ||
232 | } | ||
233 | } | ||
234 | |||
235 | timeinqueue = 0; | ||
236 | value = default(EntityUpdate); | ||
237 | return false; | ||
238 | } | ||
239 | |||
219 | /// <summary> | 240 | /// <summary> |
220 | /// Reapply the prioritization function to each of the updates currently | 241 | /// Reapply the prioritization function to each of the updates currently |
221 | /// stored in the priority queues. | 242 | /// stored in the priority queues. |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 954f21f..861b79e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4137,6 +4137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4137 | Vector3 mypos = Vector3.Zero; | 4137 | Vector3 mypos = Vector3.Zero; |
4138 | ScenePresence mysp = (ScenePresence)SceneAgent; | 4138 | ScenePresence mysp = (ScenePresence)SceneAgent; |
4139 | 4139 | ||
4140 | bool orderedDequeue = m_scene.UpdatePrioritizationScheme == UpdatePrioritizationSchemes.SimpleAngularDistance; | ||
4140 | // we should have a presence | 4141 | // we should have a presence |
4141 | if(mysp == null) | 4142 | if(mysp == null) |
4142 | return; | 4143 | return; |
@@ -4151,8 +4152,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4151 | while (maxUpdatesBytes > 0) | 4152 | while (maxUpdatesBytes > 0) |
4152 | { | 4153 | { |
4153 | lock (m_entityUpdates.SyncRoot) | 4154 | lock (m_entityUpdates.SyncRoot) |
4154 | if (!m_entityUpdates.TryDequeue(out update, out timeinqueue)) | 4155 | { |
4155 | break; | 4156 | if(orderedDequeue) |
4157 | { | ||
4158 | if (!m_entityUpdates.TryOrderedDequeue(out update, out timeinqueue)) | ||
4159 | break; | ||
4160 | } | ||
4161 | else | ||
4162 | { | ||
4163 | if (!m_entityUpdates.TryDequeue(out update, out timeinqueue)) | ||
4164 | break; | ||
4165 | } | ||
4166 | } | ||
4156 | 4167 | ||
4157 | PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; | 4168 | PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; |
4158 | 4169 | ||
@@ -4850,6 +4861,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4850 | // OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = | 4861 | // OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = |
4851 | // new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | 4862 | // new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); |
4852 | 4863 | ||
4864 | bool orderedDequeue = m_scene.UpdatePrioritizationScheme == UpdatePrioritizationSchemes.SimpleAngularDistance; | ||
4853 | 4865 | ||
4854 | EntityUpdate iupdate; | 4866 | EntityUpdate iupdate; |
4855 | Int32 timeinqueue; // this is just debugging code & can be dropped later | 4867 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
@@ -4857,8 +4869,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4857 | while (maxUpdateBytes > 0) | 4869 | while (maxUpdateBytes > 0) |
4858 | { | 4870 | { |
4859 | lock (m_entityProps.SyncRoot) | 4871 | lock (m_entityProps.SyncRoot) |
4860 | if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue)) | 4872 | { |
4861 | break; | 4873 | if(orderedDequeue) |
4874 | { | ||
4875 | if (!m_entityProps.TryOrderedDequeue(out iupdate, out timeinqueue)) | ||
4876 | break; | ||
4877 | } | ||
4878 | else | ||
4879 | { | ||
4880 | if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue)) | ||
4881 | break; | ||
4882 | } | ||
4883 | } | ||
4862 | 4884 | ||
4863 | ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate; | 4885 | ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate; |
4864 | if (update.SendFamilyProps) | 4886 | if (update.SendFamilyProps) |