On 04/03/2014 16:16, Rémy Maucherat wrote:
> Hi,
> 
> I've been working on porting a NIO2 connector that was originally developed
> for JBoss AS by Nabil Benothman (an intern at Red Hat). Due to the very
> different connector structure in Tomcat and my preference for basing it on
> the existing NIO1 connector, it is mostly new code, though.

There looks to be opportunities to share code with the current NIO
connector.

There are some changes to the existing code, such as
java/org/apache/coyote/http11/upgrade/AbstractServletInputStream.java
that I would like to understand.

> So I would now like to contribute this in trunk as a new experimental
> connector. It should have feature parity with the NIO1 connectors. Of
> course, while the basics are in, it will need some time to pass the
> testsuite, fix issues, improve stability, etc.

Can you wait until we split 8.0.x from trunk or did you want to get this
into 8.0.x?

> Coyote version number could be moved up to 2.0 with this addition along
> with all the connector refactorings that Mark did in trunk.

I'd rather drop the version number entirely as it is pretty much
meaningless. If we are going to do that, we may as well change the
server header to "Apache Tomcat". I'm neutral on whether to include the
major or full version number.

> The code is there (rebased to the current trunk):
> https://github.com/rmaucher/tomcat
> 
> A quick NIO2 (the API) presentation.
> 
> Pros:
> - Significantly faster, although the API looks slower by design
> - Resources friendly
> - Seemingly trivial to use
>  - Polling is neatly hidden away
> - Thread pool is also neatly hidden away
> - Per operation timeouts
> - Read/Write is symmetric
> - Trivial blocking IO
> 
> Cons:
> - No real non blocking IO

Hmm. I was considering dropping the BIO connector entirely for Tomcat 9
because of its inability to do non-blocking IO and the way the Servlet
API was heading. Does it make sense to add a different non-blocking
connector implementation or have I misunderstood your point?

> - No concurrency allowed [for the socket impl of NIO2] although the API
> looks concurrent

Do you mean no concurrent read and writes? That would be a huge issue.

> - Simplicity is sometimes misleading, the API doesn't provide some tools
> for the needed synchronization, check pending operations and their possible
> optimizations
> - SSL is not integrated any better than with NIO1, it is still SSLEngine
> which leads to creating the obligatory "AsynchronousSSLSocketChannel"
> wrapper class yourself
> - No real sendfile
> 
> Comments ?

The pros look nice but I am worried about the cons.

Mark

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

Reply via email to