Author: fhanik Date: Fri Mar 16 12:48:21 2007 New Revision: 519111 URL: http://svn.apache.org/viewvc?view=rev&rev=519111 Log: Being able to balance thread priorities for all kinds of threads
Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?view=diff&rev=519111&r1=519110&r2=519111 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Fri Mar 16 12:48:21 2007 @@ -274,11 +274,30 @@ ep.setThreadPriority(threadPriority); setAttribute("threadPriority", "" + threadPriority); } + + public void setAcceptorThreadPriority(int threadPriority) { + ep.setAcceptorThreadPriority(threadPriority); + setAttribute("acceptorThreadPriority", "" + threadPriority); + } + + public void setPollerThreadPriority(int threadPriority) { + ep.setPollerThreadPriority(threadPriority); + setAttribute("pollerThreadPriority", "" + threadPriority); + } public int getThreadPriority() { return ep.getThreadPriority(); } + public int getAcceptorThreadPriority() { + return ep.getAcceptorThreadPriority(); + } + + public int getPollerThreadPriority() { + return ep.getThreadPriority(); + } + + // -------------------- Tcp setup -------------------- public int getBacklog() { Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=519111&r1=519110&r2=519111 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Mar 16 12:48:21 2007 @@ -103,6 +103,7 @@ public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session"; public static final int OP_REGISTER = -1; //register interest op + // ----------------------------------------------------------------- Fields @@ -318,12 +319,25 @@ /** - * Priority of the acceptor and poller threads. + * Priority of the worker threads. */ protected int threadPriority = Thread.NORM_PRIORITY; public void setThreadPriority(int threadPriority) { this.threadPriority = threadPriority; } public int getThreadPriority() { return threadPriority; } + /** + * Priority of the acceptor threads. + */ + protected int acceptorThreadPriority = Thread.NORM_PRIORITY; + public void setAcceptorThreadPriority(int acceptorThreadPriority) { this.acceptorThreadPriority = acceptorThreadPriority; } + public int getAcceptorThreadPriority() { return acceptorThreadPriority; } + + /** + * Priority of the poller threads. + */ + protected int pollerThreadPriority = Thread.NORM_PRIORITY; + public void setPollerThreadPriority(int pollerThreadPriority) { this.pollerThreadPriority = pollerThreadPriority; } + public int getPollerThreadPriority() { return pollerThreadPriority; } /** * Server socket port. Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml?view=diff&rev=519111&r1=519110&r2=519111 ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Fri Mar 16 12:48:21 2007 @@ -412,6 +412,21 @@ <p>The number of threads to be used to run for the polling events. Default value is 1. Can't see a reason to go above that. But experiment and find your own results.</p> </attribute> + <attribute name="pollerThreadPriority" required="false"> + <p>The priority of the poller threads. + The default value is <code>java.lang.Thread#NORM_PRIORITY</code>. + See the JavaDoc for the java.lang.Thread class for more details on + what this priority means. + </p> + </attribute> + <attribute name="acceptorThreadPriority" required="false"> + <p>The priority of the acceptor threads. The threads used to accept new connections. + The default value is <code>java.lang.Thread#NORM_PRIORITY</code>. + See the JavaDoc for the java.lang.Thread class for more details on + what this priority means. + </p> + </attribute> + <attribute name="selectorTimeout" required="false"> <p>The time in milliseconds to timeout on a select() for the poller. This value is important, since connection clean up is done on the same thread, so dont set this --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]