SimpleAngularDistance update prioritization scheme ameks no sense without ordered dequeue of the updates

This commit is contained in:
UbitUmarov
2017-07-10 22:01:38 +01:00
parent f8cdccc167
commit 40b16f1705
2 changed files with 47 additions and 4 deletions

View File

@@ -216,6 +216,27 @@ namespace OpenSim.Framework
return false;
}
public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue)
{
// If there is anything in imediate queues, return it first no
// matter what else. Breaks fairness. But very useful.
for (int iq = 0; iq < NumberOfQueues; iq++)
{
if (m_heaps[iq].Count > 0)
{
MinHeapItem item = m_heaps[iq].RemoveMin();
m_lookupTable.Remove(item.Value.Entity.LocalId);
timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime);
value = item.Value;
return true;
}
}
timeinqueue = 0;
value = default(EntityUpdate);
return false;
}
/// <summary>
/// Reapply the prioritization function to each of the updates currently
/// stored in the priority queues.