directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject svn commit: r112000 - /incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java /incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java
Date Wed, 15 Dec 2004 17:10:42 GMT
Author: bloritsch
Date: Wed Dec 15 09:10:40 2004
New Revision: 112000

URL: http://svn.apache.org/viewcvs?view=rev&rev=112000
Log:
Almost remove the blocking for the pipes
Modified:
   incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java
   incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java

Modified: incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java?view=diff&rev=112000&p1=incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java&r1=111999&p2=incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java&r2=112000
==============================================================================
--- incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java
(original)
+++ incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/SEDAServer.java
Wed Dec 15 09:10:40 2004
@@ -26,12 +26,13 @@
 import org.apache.protocol.ProtocolProvider;
 import org.d_haven.event.command.ThreadManager;
 import org.d_haven.event.command.DefaultThreadManager;
+import org.d_haven.event.command.ThreadPolicy;
+import org.d_haven.event.command.ProcessorBoundThreadPolicy;
 import org.d_haven.event.impl.DefaultPipe;
 
 import java.nio.channels.SocketChannel;
 import java.nio.channels.ServerSocketChannel;
 import java.io.IOException;
-import java.net.ServerSocket;
 import java.net.InetSocketAddress;
 import java.util.Map;
 import java.util.HashMap;
@@ -58,7 +59,9 @@
         m_firewall = new Firewall();
         m_reader = new ReaderSource();
         m_writer = new Writer();
-        m_manager = new DefaultThreadManager();
+        // 5 threads per processor, and check every 100ms for new events
+        final ThreadPolicy policy = new ProcessorBoundThreadPolicy(5, 100L);
+        m_manager = new DefaultThreadManager(policy);
 
         m_connect = new ConnectSource();
         m_firewall.addSource( m_connect );

Modified: incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java?view=diff&rev=112000&p1=incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java&r1=111999&p2=incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java&r2=112000
==============================================================================
--- incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java
(original)
+++ incubator/directory/network/trunk/sedang/src/java/org/apache/directory/seda/Stage.java
Wed Dec 15 09:10:40 2004
@@ -43,6 +43,7 @@
     {
         m_sources = new LinkedList();
         m_sink = new DefaultPipe();
+        m_sink.setTimeout( 1L ); // essentially don't timeout
         m_namedSinks = new HashMap();
     }
 
@@ -77,6 +78,8 @@
         {
             throw new IllegalArgumentException("'pipe' cannot be null");
         }
+
+        pipe.setTimeout( 1L ); // essentially don't timeout
 
         m_namedSinks.put( name, pipe );
     }

Mime
View raw message