零、零拷贝概念
“Zero-copy“ describes computer operations in which the CPU does not perform the task of copying data from one memory area to another. —— wikipedia
如维基百科所说,零拷贝是指避免CPU在不同的内存区域间拷贝数据。这可具体细分为操作系统级(OS level)别和用户态(User level)级别。
“Zero-copy“ describes computer operations in which the CPU does not perform the task of copying data from one memory area to another. —— wikipedia
如维基百科所说,零拷贝是指避免CPU在不同的内存区域间拷贝数据。这可具体细分为操作系统级(OS level)别和用户态(User level)级别。
1)使用NIO多路复用技术,使其能高效的支持大量的客户端连接
2)使用主从Reactor模型,BossGroup和WorkerGroup分工明确,BossGroup只负责接收Channel,加快了客户端建立连接的速度。
以下结构图和流程图通过阅读netty-all-4.0.19.Final.jar源码分析而来。本文主要是以Server端执行过程进行分析。
1 | class ChatServer { |