activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r1137094 [2/2] - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk: ./ src/main/csharp/ src/main/csharp/State/ src/main/csharp/Transport/
Date Sat, 18 Jun 2011 00:11:22 GMT
Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/MutexTransport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/MutexTransport.cs?rev=1137094&r1=1137093&r2=1137094&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/MutexTransport.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/MutexTransport.cs
Sat Jun 18 00:11:21 2011
@@ -32,6 +32,7 @@ namespace Apache.NMS.ActiveMQ.Transport
 			if(timeout > 0)
 			{
 				DateTime timeoutTime = DateTime.Now + TimeSpan.FromMilliseconds(timeout);
+				int waitCount = 1;
 
 				while(true)
 				{
@@ -45,7 +46,9 @@ namespace Apache.NMS.ActiveMQ.Transport
 						throw new IOException(string.Format("Oneway timed out after {0} milliseconds.", timeout));
 					}
 
-					Thread.Sleep(10);
+					// Back off from being overly aggressive.  Having too many threads
+					// aggressively trying to get the lock pegs the CPU.
+					Thread.Sleep(3 * (waitCount++));
 				}
 			}
 			else

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq-test.csproj
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 00:11:21 2011
@@ -1,2 +1,2 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq-test.csproj:1082291,1135831
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq-test.csproj:1082291,1135831,1137081
 /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq-test.csproj:788230,788233,790183

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.csproj
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 00:11:21 2011
@@ -1,2 +1,2 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq.csproj:1082291,1135831
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq.csproj:1082291,1135831,1137081
 /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.csproj:788230,788233,790183

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.sln
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 00:11:21 2011
@@ -1,2 +1,2 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq.sln:1082291,1135831
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/vs2008-activemq.sln:1082291,1135831,1137081
 /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.sln:788230,788233,790183



Mime
View raw message