mirror of
https://github.com/huihut/interview.git
synced 2026-03-13 10:02:55 +08:00
fix Named pipes and Anonymous pipes
https://github.com/huihut/interview/issues/96
This commit is contained in:
@@ -1867,12 +1867,12 @@ B树/B+树 |O(log<sub>2</sub>n) | |
|
||||
#### 进程之间的通信方式以及优缺点
|
||||
|
||||
* 管道(PIPE)
|
||||
* 有名管道:一种半双工的通信方式,它允许无亲缘关系进程间的通信
|
||||
* 有名管道(命名管道):一种先进先出的通信方式,它允许无亲缘关系进程间的通信
|
||||
* 优点:可以实现任意关系的进程间的通信
|
||||
* 缺点:
|
||||
1. 长期存于系统中,使用不当容易出错
|
||||
2. 缓冲区有限
|
||||
* 无名管道:一种半双工的通信方式,只能在具有亲缘关系的进程间使用(父子进程)
|
||||
* 无名管道(匿名管道):一种单工先进先出的通信方式,只能在具有亲缘关系的进程间使用(父子进程)
|
||||
* 优点:简单方便
|
||||
* 缺点:
|
||||
1. 局限于单向通信
|
||||
|
||||
@@ -1866,12 +1866,12 @@ For non-threaded systems:
|
||||
#### Communication between processes and advantages and disadvantages
|
||||
|
||||
* Pipeline (PIPE)
|
||||
* Famous Pipeline: A half-duplex communication method that allows communication between unrelated processes
|
||||
* Named pipes: A first-in-first-out communication method that allows communication between unrelated processes
|
||||
* Advantages: can achieve inter-process communication in any relationship
|
||||
* Disadvantages:
|
||||
1. Long-term storage in the system, improper use is prone to errors
|
||||
Limited buffer
|
||||
* Unnamed pipe: a half-duplex communication method that can only be used between processes with parental relationships (parent-child processes)
|
||||
* Anonymous pipes: A simplex first-in-first-out communication method that can only be used between processes with affinity (parent-child processes)
|
||||
* Advantages: simple and convenient
|
||||
* Disadvantages:
|
||||
Limited to one-way communication
|
||||
|
||||
Reference in New Issue
Block a user