当前位置:网站首页>进程之间的通信方式
进程之间的通信方式
2022-06-26 03:09:00 【草原上唱山歌】
管道:是一种半双工方式,数据单方向流动,只能在有亲缘关系的进程间使用。它是基于内核的,可以把它当作内核缓冲区。在用户空间与内核进行交换数据需要进行四次拷贝,用户空间—>内核,内核—>内存,内存—>内核,内核—>用户空间,这里为什么要拷贝到内核呢?因为数据都是在内存中执行。在管道的数据只能被读取1次,读取之后缓冲区就不存在了,它只能承载没有格式的字节流。
命名管道:与管道类似,但是它支持没有亲缘关系的进程也可以访问(所有进程都可以访问),命名管道的名字对应磁盘索引节点。
消息队列:即消息链表,是一系列保存在内核中的消息链表,交换数据也是需要进行4次拷贝。它的优势是可以对每个消息指定特定的消息类型,接收方可不按照队列的次序获取。
共享存储:映射一段可以被其它进程访问的内存块,即内存共享,由一个进程创建,多个进程访问。用它传递数据只需要拷贝三次,即用户空间—>内存—>用户空间。
信号量:控制多个进程对共享资源的访问,可以用之进程或线程同步。
信号:是一种比较复杂的通信方式,通知接收进程某个事件已经发生了。
套接字Socket:套接字Socket是通信的基石,它是基于TCP/IP协议的网络通信的基本操作单元,是对网络通信过程中端点的抽象表示,包含网络通信的五种信息:连接使用协议、本地IP地址、本地进程的协议端口、远程IP地址、远程进程的协议端口。
边栏推荐
- 【论文笔记】Supersizing Self-supervision: Learning to Grasp from 50K Tries and 700 Robot Hours
- UE5全局光照系統Lumen解析與優化
- gstreamer分配器与pool的那些事
- Translation notes of orb-slam series papers
- 图扑软件数字孪生海上风电 | 向海图强,奋楫争先
- Qt编译出错ERROR: Unknown module(s) in QT: script
- Xiaomi TV's web page and jewelry's web page
- 给网站添加“开放搜索描述“以适配浏览器的“站点搜索“
- 虫子 拷贝构造 运算符重载
- Oracle connectivity issues and Solutions
猜你喜欢

经典模型——ResNet

The "eye" of industrial robot -- machine vision

经典模型——NiN&GoogLeNet

类图
![[hash table] a very simple zipper hash structure, so that the effect is too poor, there are too many conflicts, and the linked list is too long](/img/82/6a81e5b0d5117d780ce5910698585a.jpg)
[hash table] a very simple zipper hash structure, so that the effect is too poor, there are too many conflicts, and the linked list is too long

Components and routing

进度条

Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology

Xiaomi TV's web page and jewelry's web page

ArrayList # sublist these four holes, you get caught accidentally
随机推荐
Good news | congratulations on the addition of 5 new committers in Apache linkage (incubating) community
Distributed e-commerce project grain mall learning notes < 3 >
Question about SQL: SQL question -- SQL code for multiple account logins
Qt编译出错ERROR: Unknown module(s) in QT: script
Add console programs in UE
HL7Exception: Can‘t XML-encode a GenericMessage. Message must have a recognized struct
云计算基础-0
Preparation for wechat applet development
Golang regexp package use - 06 - other usage (Special Character conversion, find regular Common prefix, Switch gourmand mode, query regular Group NUMBER, query regular Group name, cut with regular, qu
golang正则regexp包使用-06-其他用法(特殊字符转换、查找正则共同前缀、切换贪婪模式、查询正则分组个数、查询正则分组名称、用正则切割、查询正则字串)
Leetcode 175 Combine two tables (2022.06.24)
[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior
Multimedia elements, audio, video
双碳红利+基建大年 | 图扑深耕水利水电绿色智能装备领域
P2483-[template]k short circuit /[sdoi2010] Magic pig college [chairman tree, pile]
Network PXE starts winpe and supports UEFI and legacy boot
Gradient
工作室第3次HarmonyOS培训笔记
Kotlin quick start
Analysis of technological changes in social robots