SlideServe
Menu
Préférences
© SlideServe · v2026

Analyzing File Data with Memory-Mapped I/O: An Efficient Approach

nolcha avatar
6 diapositives · 184 Views · Sep 13, 2014

In file data analysis, traditional system calls like open(), read(), and write() incur significant overhead due to disk access. Memory-mapped file I/O offers a solution by treating file operations as direct memory accesses. This technique involves mapping disk blocks into memory pages, leading to efficient access and manipulation of files. During initial access, demand paging is employed, but subsequent reads and writes are handled as routine memory operations. The OS manages modifications, ensuring data integrity when files are closed, making this approach superior for performance-oriented applications.

Analyzing File Data with Memory-Mapped I/O: An Efficient Approach - slide 1
01 / 6Analyzing File Data with Memory-Mapped I/O: An Efficient Approach
1 / 17

Télécharger la présentation

Analyzing File Data with Memory-Mapped I/O: An Efficient Approach
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Assignment 4

  2. Introduction • Typically when we think of analyzing file data we consider the use of system calls e.g ., open(), read(), write() • Each file access requires a system call and disk access • We can use virtual memory techniques to treat file I/O as routine memory accesses • This is known as memory mapping a file

  3. Basic Mechanism • Memory mapping a file I accomplished by mapping a disk block to a page (or pages) in memory. • Initial access to the file proceeds through ordinary demand paging • However, a page-sized portion of the file is read from the file system into a physical page

  4. Basic Mechanism • Subsequent reads and writes to the file are handled as routine memory accesses • Allows system to manipulate files through memory rather than incurring the overhead of of using the read() and write() system calls • Recall that the system calls involve disk I/O

  5. Basic Mechanism • Writing to a file in mapped to main memory? What happens to file? • Could be immediate but high overhead • The OS periodically checks whether the page in memory has been modified • When the file is closed, all the memory mapped data are written back to disk and removed from the virtual memory of that process

  6. mmap() System Call void * mmap (void *addr, size_tlen, intprot , int flags, intfd, off_t offset); Consult the following URL for more info: http://beej.us/guide/bgipc/output/html/multipage/mmap.html