Current location - Loan Platform Complete Network - Big data management - Linux memory mapped file system
Linux memory mapped file system
Linux system mapping path shortcut key?

First, commonly used shortcut keys under Linux

(1) Click (command or directory) to finish:

If there is no ambiguity, it will be completed once. If there is ambiguity, there will be a hint when you tap it for the second time.

(2) View History Command: Up and down arrow keys in history to view the history command.

Second, the directory structure under Linux

(1)/bin storage system executable programs (most system commands).

(2)/sbin stores the system executable program of root user.

(3)/boot stores the related files of kernel and startup program.

(4)/lib library directory, the most basic dynamic library of the storage system.

(5)/media mounts the directory of device media by default, such as USB flash drive, CD-ROM drive, etc.

(6)/mut suggests the directory of installation equipment media.

(7)/usr is used to store huge and complicated directories (unixsystemresource, directory where software is installed).

(8) Map /proc system memory (with the operation of the system, the duration changes)

(9)/ect system software startup and configuration directory

(10)/dev is used to store device files.

(1 1)/home directory, user's root directory (current user's root directory is /home/user).

Third, absolute path and relative path.

(1) Absolute path: the path starting with the root directory/

(2) Relative path: a path starting with or, where the current directory and the previous directory are indicated.

(3) usage scenarios:

Use an absolute path when the file path will not change, such as reading a configuration file;

When the relative position between the executing program and the target file remains unchanged, use a relative path, such as makefile.

What is the mmap file memory mapping mechanism of Linux?

* * * Memory sharing allows two or more processes * * * to share a given storage area, because data does not need to be copied back and forth, so it is the fastest communication mechanism between processes. * * * Memory sharing can be realized through mmap () mapping ordinary files (anonymous mapping can also be used in special cases) or through system V*** memory sharing mechanism. The application interface and principle are simple, and the internal mechanism is complex. In order to achieve more secure communication, it is usually used with synchronization mechanisms (such as signal lights). The mechanism of mmap is to create a file on disk, and each process memory has a separate space for mapping. If there are multiple processes, it will not consume too much actual physical memory (main memory). Shm mechanism: the shared memory of each process is directly mapped to the actual physical memory.

1, mmap is saved to the actual hard disk, and the actual storage is not reflected in the main memory. Advantages: the storage capacity can be very large (exceeding the main memory); Disadvantages: Inter-process reading and writing speed is slower than main memory.

2.shm is stored in physical memory (main memory), and the actual storage amount is directly reflected in main memory. Advantages: interprocess access speed (reading and writing) is faster than that of disk; Disadvantages: the storage capacity cannot be very large (more than the main memory). Usage: If the allocated storage capacity is not large, then use shm;; If the storage capacity is large, use mmap.