Linux I/O 原理和零拷贝
最近在阅读消息中间件相关的源码,在消息存取时用到了mmap或者page cache又或者transferTo、sendFile等技术,来减少数据存取时的模式切换(用户态到内核态)和数据复制(将数据从一个存储区复制到另一个存储区)。这篇文章就来探究一下零拷贝技术到底是什么。
零拷贝的概念
wikipedia中介绍:
“Zero-copy” describes computer operations in which the CPU does not perform the task of copying data from one memory area to another. This is