Netty 中的零拷贝机制
理解零拷贝
零拷贝是Netty的重要特性之一,而究竟什么是零拷贝呢? WIKI中对其有如下定义:
"Zero-copy" describes computer operations in which the CPU does not perform the task of copying data from one memory area to another.
从WIKI的定义中,我们看到“零拷贝”是指计算机操作的过程中,CPU不需要为数据在内存之间的拷贝消耗资源。而它通常是指计算机在网络上发送文件时,不需要将文件内容拷贝到用户空间(User Space)而直接在内核空间(Kernel Space)中传输到网络的方式。
Non-Zero Copy方式:
This chapter requires login to view full content. You are viewing a preview.
Login to View Full Content