Skip to content

Commit

Permalink
✏更新 操作系统 多处理机系统
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcaffebabe committed Dec 28, 2020
1 parent 1c3d4a9 commit 79561f2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
Binary file added assets/屏幕截图 2020-12-28 150620.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/屏幕截图 2020-12-28 151614.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/屏幕截图 2020-12-28 152125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 34 additions & 5 deletions 操作系统/多处理机系统.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,41 @@

统一芯片包含着多个不同架构不同指令集的异构核心

## 多处理机操作系统类型
### 多处理机操作系统类型

- 每个CPU有自己的操作系统
- 主从多处理机
- 对称多处理机
- 多处理机同步
#### 每个CPU有自己的操作系统

![屏幕截图 2020-12-28 150620](/assets/屏幕截图%202020-12-28%20150620.png)

每个CPU都可以共享内存与IO资源

但是可能造成资源使用不均衡 但最要命的是各个CPU都要各自维护自己的磁盘缓冲区 就会造成不一致的情况

##### 主从多处理机

![屏幕截图 2020-12-28 151614](/assets/屏幕截图%202020-12-28%20151614.png)

所有的系统调用都要经过主CPU 主CPU会成为瓶颈 对小型多处理机是可行的

##### 对称多处理机

![屏幕截图 2020-12-28 152125](/assets/屏幕截图%202020-12-28%20152125.png)

一种方式是任何时刻都只能有一个CPU运行操作系统

另一种方式是将操作系统分割成互不影响的临界区 不同的CPU处理不同的功能 实现并行操作

### 多处理机同步

TSL(test and set lock)

必须先锁住总线 然后再进行读写访问

但这样如果冲突过于频繁 总线有效流量负载就大大下降 为了解决这个问题:

- 锁总线之前使用一个纯读操作测试总线是否空闲
- 发生冲突时,使用二进制指数回退算法
- 更好的方法是,发生冲突后,每个CPU等待的时间都不同 以避免再次冲突

## 多处理机调度

Expand Down

0 comments on commit 79561f2

Please sign in to comment.