Sample Header Ad - 728x90

What is the path of data transfer when using memory mapped file?

-1 votes
1 answer
945 views
Is there any difference between the data transfer paths using read()/write() and using mmap() on a file? What does "kernel" mean in https://stackoverflow.com/a/41419353 ? > mmap doesn't require a copy of the file data from **kernel** to user-space. Is it correct that read() copies data from file to a buffer in kernel space , then from the kernel buffer to a buffer in user space? When calling mmap() on a file, does it map virtual memory addresses directly to the file, without anything (e.g. a buffer in kernel space) in between? When accessing virtual memory addresses returned by mmap(), what is the path for data transfer? Is there any buffer in kernel space involved in the middle behind the scene? Does mmap() have an advantage over read()/write(), as far as data transfer path is concerned?
Asked by Tim (106430 rep)
Nov 24, 2020, 02:53 PM
Last activity: Nov 24, 2020, 04:13 PM