use a dedicated MinHeap for updates priority

This commit is contained in:
UbitUmarov
2020-09-18 22:56:32 +01:00
parent d0606d5d5b
commit 2f82203c3b
4 changed files with 255 additions and 161 deletions

View File

@@ -50,25 +50,14 @@ namespace OpenSim.Region.Framework.Scenes
{
// for priority queue
private uint m_pqueue;
public int PriorityQueue;
public int PriorityQueueIndex;
private ulong m_entryorder;
private ISceneEntity m_entity;
private PrimUpdateFlags m_flags;
public ObjectPropertyUpdateFlags m_propsFlags;
public uint PriorityQueue
{
get
{
return m_pqueue;
}
set
{
m_pqueue = value;
}
}
public ulong EntryOrder
{
get
@@ -111,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes
set { m_flags = value; }
}
public void Update(uint pqueue, ulong entry)
public void Update(int pqueue, ulong entry)
{
if ((m_flags & PrimUpdateFlags.CancelKill) != 0)
{
@@ -121,11 +110,11 @@ namespace OpenSim.Region.Framework.Scenes
m_flags = PrimUpdateFlags.FullUpdatewithAnim;
}
m_pqueue = pqueue;
PriorityQueue = pqueue;
m_entryorder = entry;
}
public void Update(EntityUpdate oldupdate, uint pqueue, ulong entry)
public void Update(EntityUpdate oldupdate, int pqueue, ulong entry)
{
// we are on the new one
m_propsFlags |= oldupdate.PropsFlags;
@@ -133,6 +122,7 @@ namespace OpenSim.Region.Framework.Scenes
PrimUpdateFlags updateFlags = oldupdate.Flags;
if ((m_flags & PrimUpdateFlags.UpdateProbe) != 0)
updateFlags &= ~PrimUpdateFlags.UpdateProbe;
if ((m_flags & PrimUpdateFlags.CancelKill) != 0)
{
if ((m_flags & PrimUpdateFlags.UpdateProbe) != 0)
@@ -143,13 +133,36 @@ namespace OpenSim.Region.Framework.Scenes
else
m_flags |= updateFlags;
m_pqueue = pqueue;
PriorityQueue = pqueue;
m_entryorder = entry;
}
public void UpdateFromNew(EntityUpdate newupdate, int pqueue)
{
// we are on the new one
m_propsFlags |= newupdate.PropsFlags;
PrimUpdateFlags newFlags = newupdate.Flags;
if ((newFlags & PrimUpdateFlags.UpdateProbe) != 0)
m_flags &= ~PrimUpdateFlags.UpdateProbe;
if ((newFlags & PrimUpdateFlags.CancelKill) != 0)
{
if ((newFlags & PrimUpdateFlags.UpdateProbe) != 0)
m_flags = PrimUpdateFlags.UpdateProbe;
else
newFlags = PrimUpdateFlags.FullUpdatewithAnim;
}
else
m_flags |= newFlags;
PriorityQueue = pqueue;
}
public void Free()
{
m_entity = null;
PriorityQueueIndex = -1;
EntityUpdatesPool.Free(this);
}
@@ -173,7 +186,7 @@ namespace OpenSim.Region.Framework.Scenes
public override string ToString()
{
return String.Format("[{0},{1},{2}]", m_pqueue, m_entryorder, m_entity.LocalId);
return String.Format("[{0},{1},{2}]", PriorityQueue, m_entryorder, m_entity.LocalId);
}
public int CompareTo(EntityUpdate other)