tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
Date Tue, 13 Jan 2004 10:16:39 GMT
remm        2004/01/13 02:16:39

  Modified:    util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - So I'm removing the pool thing. Feel free to let me know if this was actually
    useful.
  
  Revision  Changes    Path
  1.31      +10 -33    jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- PoolTcpEndpoint.java	13 Jan 2004 09:56:24 -0000	1.30
  +++ PoolTcpEndpoint.java	13 Jan 2004 10:16:38 -0000	1.31
  @@ -535,29 +535,17 @@
          We also want to use per/thread data and avoid sync wherever possible.
       */
       PoolTcpEndpoint endpoint;
  -    SimplePool connectionCache;
  -    static final boolean usePool=false;
       
       public TcpWorkerThread(PoolTcpEndpoint endpoint) {
   	this.endpoint = endpoint;
  -	if( usePool ) {
  -	    connectionCache = new SimplePool(endpoint.getMaxThreads());
  -	    for(int i = 0 ; i < endpoint.getMaxThreads()/2 ; i++) {
  -		connectionCache.put(new TcpConnection());
  -	    }
  -	}
       }
   
       public Object[] getInitData() {
  -	if( usePool ) {
  -	    return endpoint.getConnectionHandler().init();
  -	} else {
  -	    // no synchronization overhead, but 2 array access 
  -	    Object obj[]=new Object[2];
  -	    obj[1]= endpoint.getConnectionHandler().init();
  -	    obj[0]=new TcpConnection();
  -	    return obj;
  -	}
  +        // no synchronization overhead, but 2 array access 
  +        Object obj[]=new Object[2];
  +        obj[1]= endpoint.getConnectionHandler().init();
  +        obj[0]=new TcpConnection();
  +        return obj;
       }
       
       public void runIt(Object perThrData[]) {
  @@ -590,19 +578,11 @@
   
                       // 3: Process the connection
                       step = 3;
  -		    if( usePool ) {
  -			con=(TcpConnection)connectionCache.get();
  -			if( con == null ) 
  -			    con = new TcpConnection();
  -		    } else {
  -                        con = (TcpConnection) perThrData[0];
  -                        perThrData = (Object []) perThrData[1];
  -		    }
  -
  +                    con = (TcpConnection) perThrData[0];
   		    con.setEndpoint(endpoint);
   		    con.setSocket(s);
   		    endpoint.getConnectionHandler()
  -                        .processConnection(con, perThrData);
  +                        .processConnection(con, (Object []) perThrData[1]);
   
                   } catch (SocketException se) {
                       endpoint.log.error
  @@ -625,9 +605,6 @@
                   } finally {
                       if (con != null) {
                           con.recycle();
  -                        if (usePool) {
  -                            connectionCache.put(con);
  -                        }
                       }
                   }
   	    }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message