From f89c2cac0fd3e9e1ae66552bbc2c3cc4bb17aaed Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 14:16:01 -0700 Subject: Experimental test to rate limit the incoming packet handler and try to always leave a worker thread available for other tasks --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index e3233da..74d3262 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -801,6 +801,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP { IncomingPacket incomingPacket = null; + // HACK: This is a test to try and rate limit packet handling on Mono. + // If it works, a more elegant solution can be devised + if (Util.FireAndForgetCount() < 2) + { + //m_log.Debug("[LLUDPSERVER]: Incoming packet handler is sleeping"); + Thread.Sleep(30); + } + if (packetInbox.Dequeue(100, ref incomingPacket)) Util.FireAndForget(ProcessInPacket, incomingPacket); } -- cgit v1.1