actually let delay match throttles as original design

avinationmerge
UbitUmarov 2014-08-10 16:36:20 +01:00
parent ebc18a80bf
commit c0378d5430
1 changed files with 9 additions and 11 deletions

View File

@ -301,8 +301,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <remarks> /// <remarks>
/// This allows the outbound loop to only operate when there is data to send rather than continuously polling. /// This allows the outbound loop to only operate when there is data to send rather than continuously polling.
/// Some data is sent immediately and not queued. That data would not trigger this event. /// Some data is sent immediately and not queued. That data would not trigger this event.
/// WRONG use. May be usefull in future revision
/// </remarks> /// </remarks>
private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); // private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false);
private Pool<IncomingPacket> m_incomingPacketPool; private Pool<IncomingPacket> m_incomingPacketPool;
@ -990,8 +991,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
if (packetQueued) /// WRONG use. May be usefull in future revision
m_dataPresentEvent.Set(); // if (packetQueued)
// m_dataPresentEvent.Set();
} }
/// <summary> /// <summary>
@ -2153,14 +2155,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// token bucket could get more tokens // token bucket could get more tokens
if (!m_packetSent) if (!m_packetSent)
// Thread.Sleep((int)TickCountResolution); Thread.Sleep((int)TickCountResolution);
Thread.Sleep(20); // be independent of TickCountResolution
// // .... wrong core code removed
// Instead, now wait for data present to be explicitly signalled. Evidence so far is that with
// modern mono it reduces CPU base load since there is no more continuous polling.
// this misses heavy load cases
// if (!m_packetSent)
// m_dataPresentEvent.WaitOne(100);
Watchdog.UpdateThread(); Watchdog.UpdateThread();
} }