diff options
author | Justin Clark-Casey (justincc) | 2013-07-18 01:17:46 +0100 |
---|---|---|
committer | Diva Canto | 2013-07-18 12:28:02 -0700 |
commit | d9d995914c5fba00d4ccaf66b899384c8ea3d5eb (patch) | |
tree | ec447f6278c040a4803f6e7bab0b3f509f5fd4ba /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | Revert "Revert "I confuse myself. Let's try this variable name instead."" (diff) | |
download | opensim-SC-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.zip opensim-SC-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.tar.gz opensim-SC-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.tar.bz2 opensim-SC-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.tar.xz |
try Hacking in an AutoResetEvent to control the outgoing UDP loop instead of a continuous loop with sleeps.
Does appear to have a cpu impact but may need further tweaking
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 85270a6..54cafb2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -806,8 +806,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
806 | } | 806 | } |
807 | 807 | ||
808 | PacketPool.Instance.ReturnPacket(packet); | 808 | PacketPool.Instance.ReturnPacket(packet); |
809 | m_dataPresentEvent.Set(); | ||
810 | |||
809 | } | 811 | } |
810 | 812 | ||
813 | private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); | ||
814 | |||
811 | /// <summary> | 815 | /// <summary> |
812 | /// Start the process of sending a packet to the client. | 816 | /// Start the process of sending a packet to the client. |
813 | /// </summary> | 817 | /// </summary> |
@@ -1658,6 +1662,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1658 | // Action generic every round | 1662 | // Action generic every round |
1659 | Action<IClientAPI> clientPacketHandler = ClientOutgoingPacketHandler; | 1663 | Action<IClientAPI> clientPacketHandler = ClientOutgoingPacketHandler; |
1660 | 1664 | ||
1665 | // while (true) | ||
1661 | while (base.IsRunningOutbound) | 1666 | while (base.IsRunningOutbound) |
1662 | { | 1667 | { |
1663 | try | 1668 | try |
@@ -1718,8 +1723,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1718 | 1723 | ||
1719 | // If nothing was sent, sleep for the minimum amount of time before a | 1724 | // If nothing was sent, sleep for the minimum amount of time before a |
1720 | // token bucket could get more tokens | 1725 | // token bucket could get more tokens |
1721 | if (!m_packetSent) | 1726 | //if (!m_packetSent) |
1722 | Thread.Sleep((int)TickCountResolution); | 1727 | // Thread.Sleep((int)TickCountResolution); |
1728 | m_dataPresentEvent.WaitOne(100); | ||
1723 | 1729 | ||
1724 | Watchdog.UpdateThread(); | 1730 | Watchdog.UpdateThread(); |
1725 | } | 1731 | } |