Epoll_native non-blocking transport for Linux

 Epoll_native non-blocking transport for Linuxpromise

As we explained earlier, Netty’s NIO transport is based on the common abstraction forapp

asynchronous/non-blocking networking provided by Java. Although this ensures thatless

Netty’s non-blocking API will be usable on any platform, it also entails limitations,async

because the JDK has to make compromises(妥協,折中) in order to deliver the same capabilities on all systems.ide

 The growing importance of Linux as a platform for high-performance networkingoop

has led to the development of a number of advanced features, including epoll, a highlythis

scalable I/O event-notification feature. This API, available since version 2.5.44 (2002)spa

of the Linux kernel, provides better performance than the older POSIX select and.net

poll system calls and is now the defacto(事實上的) standard for non-blocking networking onscala

Linux. The Linux JDK NIO API uses these epoll calls.

 Netty provides an NIO API for Linux that uses epoll in a way that’s more consistent

with its own design and less costly in the way it uses interrupts.

 Consider utilizing(利用,使用) this version if your applications are intended for Linux; you’ll find that performance under heavy load is superior to that of the JDK’s NIO implementation.

 The semantics of this transport are identical to those shown in figure 4.2, and its

use is straightforward. For an example, refer to listing 4.4. To substitute(代替,替換) epoll for NIO

in that listing, replace NioEventLoopGroup with EpollEventLoopGroup and NioServerSocketChannel.class with EpollServerSocketChannel.class.

http://my.oschina.net/xinxingegeya/blog/640423

=========END=========

相關文章
相關標籤/搜索