Shared memory mode: Take part of the physical memory and share it as multiple processes.
Shared memory is the fastest way to share data between processes. A process writes data to a shared memory area, and all processes sharing the memory can see the contents immediately.
Shared Memory Implementation Steps:
First, create shared memory, use the shmget function.
Second, map shared memory, map the created shared memory to the specific process space, use the shmat function.
Creating shared memory shmget:
intshmget(key_t key, size_t size, int shmflg)
Function: Get a shared memory identifier or create a shared memory object and return Shared memory identifier.
key: 0(IPC_PRIVATE) will create a shared memory object
size: an integer greater than 0, the size of the new shared memory, in bytes. When only shared memory is obtained, it is specified as 0.
shmflg:
0 means to take the shared memory identifier, if it does not exist, the function will report an error;
IPC_CREAT, if the kernel If there is no shared memory with the same key value and key, then create a shared memory; if there is such shared memory, return the identifier of the shared memory;
IPC_CREAT
How to uninstall the built-in JDK under Linux, many of us can find java under the operating system
At present, many schools have built campus networks and connected to the Internet, but there are so
1. In STM32, there are five clock sources, HSI, HSE, LSI, LSE, PLL. 1, HSI is a high-speed internal
The SELinux function is an implementation of mandatory access control, which can
The best database management software under linux
Linux vsftp configuration tutorial
ARM Linux development common shell script command summary
Network configuration basic tutorial under LINUX
How to check HTTP traffic on Linux
Squid3 reverse proxy installation and configuration basic tutorial
Teach you completely free self-built Linux firewall
The problem of the pipeline being closed by the acceptor in the Linux system is solved
Win8 account management knowledge How to add a child rating account?
Win10 build 10130 pop-up window no response patch
How to open the temporary data clipboard in Win7 Ultimate system
Win7 system enters the wrong password to lock the computer
How to use System Restore and Mirror Backup under Windows 7
What should I do if my WindowsX system desktop card is dead?
Win2003 how to cancel the shutdown option 2003 cancel the shutdown prompt window method