mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Experimental test to rate limit the incoming packet handler and try to always leave a worker thread available for other tasks
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user