当前位置:网站首页>Mode of interprocess communication
Mode of interprocess communication
2022-04-23 18:03:00 【OceanKeeper1215】
The ways of inter process communication are :
One 、 The Conduit
The Conduit , Usually refers to the unnamed pipe , yes UNIX System IPC The oldest form .
characteristic :
It's half duplex ( That is, data can only flow in one direction ), It has fixed read end and write end .
It can only be used for communication between related processes ( It's also between parent-child processes or sibling processes ).
It can be seen as a special document , For its reading and writing, you can also use ordinary read、write Such as function . But it's not a normal document , It doesn't belong to any other file system , And it only exists in memory .
Two 、FIFO
FIFO, Also called named pipe , It's a file type .
1、 characteristic
FIFO Data can be exchanged between unrelated processes , It's different from anonymous pipes .
FIFO There is a pathname associated with it , It exists in the file system as a special device file .
3、 ... and 、 Message queue
Message queue , It's a linked list of messages , Stored in the kernel . A message queue consists of an identifier ( That's the queue ID) To mark .
characteristic
Message queuing is record oriented , The message has a specific format and a specific priority .
Message queuing is independent of the sending and receiving processes . When the process terminates , Message queues and their contents are not deleted .
Message queue can realize random query of messages , Messages don't have to be read in first in first out order , It can also be read by the type of message .
Four 、 Semaphore
Semaphore (semaphore) With what has been introduced IPC Different structure , It's a counter . Semaphores are used to achieve mutual exclusion and synchronization between processes , Instead of storing interprocess communication data .
characteristic
Semaphores are used for inter process synchronization , To transfer data between processes, you need to combine shared memory .
Semaphores are based on the PV operation , The operation of the program on semaphores is atomic operation .
Every time the semaphore is PV The operation is not limited to adding... To the semaphore value 1 Or minus 1, And you can add and subtract any positive integer .
Support semaphore group .
5、 ... and 、 Shared memory
Shared memory (Shared Memory), Refers to two or more processes sharing a given store .
characteristic
Shared memory is the fastest IPC, Because processes access memory directly .
Because multiple processes can operate at the same time , So you need to synchronize .
Semaphore + Shared memory is usually used in combination , Semaphores are used to synchronize access to shared memory .
版权声明
本文为[OceanKeeper1215]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545105007.html
边栏推荐
- Process management command
- Cross domain settings of Chrome browser -- including new and old versions
- ArcGIS license error -15 solution
- C1 notes [task training chapter I]
- Qtablewidget usage explanation
- Docker 安装 Redis
- Dock installation redis
- C# 网络相关操作
- The ultimate experience, the audio and video technology behind the tiktok
- How to read literature
猜你喜欢
cv_ Solution of mismatch between bridge and opencv
C1 notes [task training part 2]
GDAL + ogr learning
Jenkspy package installation
C1 notes [task training chapter I]
C#的随机数生成
.105Location
Dock installation redis
Install pyshp Library
Implementation of image recognition code based on VGg convolutional neural network
随机推荐
Flash - Middleware
Welcome to the markdown editor
mysql自动启动设置用Systemctl start mysqld启动
2022江西储能技术展会,中国电池展,动力电池展,燃料电池展
Amount input box, used for recharge and withdrawal
Open source key component multi_ Button use, including test engineering
587. Install fence / Sword finger offer II 014 Anagrams in strings
解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
Basic usage of crawler requests
JS high frequency interview questions
How to read literature
Install pyshp Library
Flash operates on multiple databases
C# 网络相关操作
Submit local warehouse and synchronize code cloud warehouse
Crawl the product data of Xiaomi Youpin app
Crawling mobile game website game details and comments (MQ + multithreading)
xlsxwriter. exceptions. Filecreateerror: [errno 13] permission denied
Summary of common server error codes
Arcpy adds fields and loop assignments to vector data