Skip to content

Commit 7ba1006

Browse files
add
1 parent 566e3c2 commit 7ba1006

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

lec10/p1-ipcoverview.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ $ cat name.fifo
276276

277277
---
278278
#### 消息队列实现机制
279-
![w:900](figs/signal-imp2.jpg)
279+
280+
- 不同消息类型
281+
- 优先级排序
282+
- 选择性接收
283+
- 安全和隔离
284+
285+
![bg right:62% 90%](figs/signal-imp2.jpg)
280286

281287

282288
---
@@ -450,7 +456,7 @@ Child: read msg:test
450456
```
451457
#include <sys/ipc.h>
452458
#include <sys/shm.h>
453-
int shmget(key_t key, size_t size,int shmflg);
459+
int shmget(key_t key, size_t size, int shmflg);
454460
```
455461
- key:进程间通信键值,ftok() 的返回值。
456462
- size:该共享存储段的长度(字节)。
@@ -480,7 +486,7 @@ void *shmat(int shmid, const void *shmaddr, int shmflg);
480486
void *shmat(int shmid, const void *shmaddr, int shmflg);
481487
```
482488
- shmid:共享内存标识符,shmget() 的返回值。
483-
- shmaddr:共享内存映射地址,若为 NULL 则由系统自动指定
489+
- shmaddr:共享内存映射地址,若为 NULL 则由系统自动指定
484490
- shmflg:共享内存段的访问权限和映射条件,取值如下:
485491
- 0:共享内存具有可读可写权限。
486492
- SHM_RDONLY:只读。
@@ -611,7 +617,8 @@ Signals and Inter-Process Communication https://compas.cs.stonybrook.edu/~nhona
611617
- 模拟用户代码调用sig_handler函数
612618
- 内核在陷入上下文中修改用户态返回地址;
613619
- 内核返回用户态,直接跳到sig_handler;
614-
- sig_handler函数返回到旧代码位置继续执行
620+
- 执行sig_handler函数结束后,自动通过系统调用sigreturn陷入内核态
621+
- sigreturn恢复进程正常执行的上下文,返回用户态继续执行
615622
![bg right:31% 95%](figs/CatchingSignal.png)
616623

617624
---

lec9/p3-fsjournal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ backgroundColor: white
8787

8888
##### 文件更新过程示例
8989

90-
一个应用以某种方式更新磁盘结构:将单个数据块附加到原有文件。
90+
考虑一个应用以某种方式更新磁盘结构:将单个数据块附加到原有文件。
9191
- 通过打开文件,调用`lseek()`将文件偏移量移动到文件末尾,然后在关闭文件之前,向文件发出单个4KB写入来完成追加。
9292

9393
---
@@ -110,7 +110,7 @@ backgroundColor: white
110110

111111
##### 文件更新中的磁盘操作
112112

113-
一个应用以某种方式更新磁盘结构:将单个数据块附加到原有文件
113+
考虑一个应用以某种方式更新磁盘结构:将单个数据块附加到原有文件
114114
- 必须对磁盘执行**3次单独写入**
115115
- inode(I[v2])、位图(B[v2])和数据块(Db)
116116
- 发出write()系统调用时,这些写操作通常不会立即发生。

0 commit comments

Comments
 (0)