[Linux] mmap & lseek

Usually, file are accessed using various functions. However, these seems to incur a lot of overhead. Therefore, for fast access, you would use mmap() to map certain variable to the memory address and lseek() would be used to move within that file.

There can be an example of this since usually this file is mapped to DRAM and it is volatile. To write this on the disk, you would use msync(). Failure can happen during the process, which is Failure-Atomic msync(). Terence Kelly seems to be actively working on this.

Reference

https://jameshfisher.com/2017/01/28/mmap-file-write.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.