From 51ea39199bc875aa0803231aa1dfc43471fcabd6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 8 Oct 2009 15:42:08 -0700 Subject: Putting the lock back in TryGetValue. --- .../ClientStack/LindenUDP/LLUDPClientCollection.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs index f6ccf01..dbb9861 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs @@ -224,16 +224,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP ////return success; - //lock (m_sync) - // return Dictionary1.TryGetValue(key, out value); + lock (m_sync) + return Dictionary1.TryGetValue(key, out value); - try - { - return Dictionary1.TryGetValue(key, out value); - } - catch { } - value = null; - return false; + //try + //{ + // return Dictionary1.TryGetValue(key, out value); + //} + //catch { } + //value = null; + //return false; } public bool TryGetValue(IPEndPoint key, out LLUDPClient value) -- cgit v1.1 From 8231cb22316e9492dd9e295ac9156689bede2ec3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 9 Oct 2009 11:32:53 -0700 Subject: Putting this to exactly what it was yesterday around this time, so we can do the 100-ppl load test in WP. We need to carefully play with this code in order to understand all the problems. --- .../ClientStack/LindenUDP/LLUDPClientCollection.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs index dbb9861..784426f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs @@ -247,16 +247,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP ////return success; - lock (m_sync) - return Dictionary2.TryGetValue(key, out value); - - //try - //{ + //lock (m_sync) // return Dictionary2.TryGetValue(key, out value); - //} - //catch { } - //value = null; - //return false; + + try + { + return Dictionary2.TryGetValue(key, out value); + } + catch { } + value = null; + return false; } -- cgit v1.1 From 3f78ff6ee0837c0179be5f43d485d9ca23ee454b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 9 Oct 2009 19:16:03 -0700 Subject: Slight variation on the locking scheme: now locking always, except the ForEach, which gets a copy of the Array. I think the ForEach was the big gorilla. --- .../ClientStack/LindenUDP/LLUDPClientCollection.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs index 784426f..dbb9861 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs @@ -247,16 +247,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP ////return success; - //lock (m_sync) - // return Dictionary2.TryGetValue(key, out value); - - try - { + lock (m_sync) return Dictionary2.TryGetValue(key, out value); - } - catch { } - value = null; - return false; + + //try + //{ + // return Dictionary2.TryGetValue(key, out value); + //} + //catch { } + //value = null; + //return false; } -- cgit v1.1