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 | |
parent | Revert "Revert "I confuse myself. Let's try this variable name instead."" (diff) | |
download | opensim-SC_OLD-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.zip opensim-SC_OLD-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.tar.gz opensim-SC_OLD-d9d995914c5fba00d4ccaf66b899384c8ea3d5eb.tar.bz2 opensim-SC_OLD-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
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 10 |
2 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 79c80a7..7229d7c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -3776,6 +3776,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3776 | ResendPrimUpdate(update); | 3776 | ResendPrimUpdate(update); |
3777 | } | 3777 | } |
3778 | 3778 | ||
3779 | // OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); | ||
3780 | // OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>(); | ||
3781 | // OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | ||
3782 | // OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | ||
3783 | // | ||
3784 | // OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3785 | // OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3786 | // OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3787 | // OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3788 | |||
3789 | |||
3779 | private void ProcessEntityUpdates(int maxUpdates) | 3790 | private void ProcessEntityUpdates(int maxUpdates) |
3780 | { | 3791 | { |
3781 | OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); | 3792 | OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); |
@@ -3788,6 +3799,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3788 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 3799 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
3789 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | 3800 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); |
3790 | 3801 | ||
3802 | // objectUpdateBlocks.Value.Clear(); | ||
3803 | // compressedUpdateBlocks.Value.Clear(); | ||
3804 | // terseUpdateBlocks.Value.Clear(); | ||
3805 | // terseAgentUpdateBlocks.Value.Clear(); | ||
3806 | // objectUpdates.Value.Clear(); | ||
3807 | // compressedUpdates.Value.Clear(); | ||
3808 | // terseUpdates.Value.Clear(); | ||
3809 | // terseAgentUpdates.Value.Clear(); | ||
3810 | |||
3791 | // Check to see if this is a flush | 3811 | // Check to see if this is a flush |
3792 | if (maxUpdates <= 0) | 3812 | if (maxUpdates <= 0) |
3793 | { | 3813 | { |
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 | } |