From ebc18a80bf87ca204c5d590bec0b2415f010ff83 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 10 Aug 2014 14:49:58 +0100 Subject: OutgoingPacketHandler can not be paced by hits on SendPacket() --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index a3fdae1..e317fc0 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1418,6 +1418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP queue.Enqueue(buffer); return; } + else if (packet.Type == PacketType.CompleteAgentMovement) { // Send ack straight away to let the viewer know that we got it. @@ -2150,13 +2151,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If nothing was sent, sleep for the minimum amount of time before a // token bucket could get more tokens - //if (!m_packetSent) - // Thread.Sleep((int)TickCountResolution); + + if (!m_packetSent) +// Thread.Sleep((int)TickCountResolution); + Thread.Sleep(20); // be independent of TickCountResolution // // 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. - if (!m_packetSent) - m_dataPresentEvent.WaitOne(100); + // this misses heavy load cases +// if (!m_packetSent) +// m_dataPresentEvent.WaitOne(100); Watchdog.UpdateThread(); } -- cgit v1.1 From c0378d54304b2b6bde4a3c24eb137f664716ae81 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 10 Aug 2014 16:36:20 +0100 Subject: actually let delay match throttles as original design --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index e317fc0..0bb53c4 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -301,8 +301,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// 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. + /// WRONG use. May be usefull in future revision /// - private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); +// private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); private Pool m_incomingPacketPool; @@ -990,8 +991,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP PacketPool.Instance.ReturnPacket(packet); - if (packetQueued) - m_dataPresentEvent.Set(); + /// WRONG use. May be usefull in future revision +// if (packetQueued) +// m_dataPresentEvent.Set(); } /// @@ -2153,14 +2155,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // token bucket could get more tokens if (!m_packetSent) -// Thread.Sleep((int)TickCountResolution); - Thread.Sleep(20); // be independent of TickCountResolution - // - // 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); + Thread.Sleep((int)TickCountResolution); + + // .... wrong core code removed + Watchdog.UpdateThread(); } -- cgit v1.1