当前位置:网站首页>Communication mode between processes

Communication mode between processes

2022-06-26 03:38:00 Singing folk songs on the grassland

The Conduit : It is a half duplex mode , Data flows in one direction , Can only be used between related processes . It is kernel based , You can use it as a kernel buffer . Four copies are required to exchange data with the kernel in user space , User space —> kernel , kernel —> Memory , Memory —> kernel , kernel —> User space , Why copy to the kernel here ? Because the data is executed in memory . The data in the pipeline can only be read 1 Time , After reading, the buffer does not exist , It can only carry unformatted byte streams .
name pipes : Similar to pipes , But it allows unrelated processes to access ( All processes can access ), The name of the named pipe corresponds to the disk inode .
Message queue : Message linked list , Is a series of message linked lists stored in the kernel , Data exchange also needs to be done 4 Second copy . Its advantage is that you can specify a specific message type for each message , The receiver may not get the information in the order of the queue .
Shared memory : Map a memory block that can be accessed by other processes , Memory sharing , Created by a process , Multiple process access . It only needs to be copied three times to transfer data , That's user space —> Memory —> User space .
Semaphore : Control the access of multiple processes to shared resources , It can be used to synchronize processes or threads .
The signal : It's a complicated way of communication , Notify the receiving process that an event has occurred .
Socket Socket: Socket Socket Is the cornerstone of communication , It is based on TCP/IP Basic operation unit of network communication of protocol , It is an abstract representation of the endpoint in the process of network communication , Contains five types of information for network communication : Connection use protocol 、 Local IP Address 、 Protocol port of local process 、 long-range IP Address 、 The protocol port of the remote process .

原网站

版权声明
本文为[Singing folk songs on the grassland]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260309118855.html