activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r478238 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Date Wed, 22 Nov 2006 16:59:26 GMT
Author: rajdavies
Date: Wed Nov 22 08:59:26 2006
New Revision: 478238

URL: http://svn.apache.org/viewvc?view=rev&rev=478238
Log:
added yield back into dispatch() - but with a counter - so not so much of a performance hog

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?view=diff&rev=478238&r1=478237&r2=478238
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Wed Nov 22 08:59:26 2006
@@ -106,6 +106,7 @@
     private int rollbackCounter = 0;
     private long redeliveryDelay = 0;
     private int ackCounter = 0;
+    private int dispatchedCount = 0;
     private MessageListener messageListener;
     private JMSConsumerStatsImpl stats;
 
@@ -876,6 +877,10 @@
 	                    }
 	                }
 	            }
+            }
+            if (++dispatchedCount%1000==0) {
+                dispatchedCount=0;
+            Thread.yield();
             }
         } catch (Exception e) {
         	session.connection.onAsyncException(e);



Mime
View raw message