国防科大的P17(讲信号量的例子),没看
两种基本进程间通讯方法
共享存储
消息传递
死锁
在一个进程集合中,每个进程都在等待某些事件的发生,而这些事件又必须由这个进程集合中的进程来产生
就称该进程集合处于死锁状态
出现死锁的系统必须同时满足下列4个必要条件
1.互斥:资源是互斥使用
2.占有等待:占有资源而又等待其他资源的进程
3.非剥夺:进程占有的资源只能主动释放
4.循环等待:存在进程循环等待
不连续空间分配
页式管理
C语言中的地址都是逻辑地址Virtual
Paged memory management
#进程的虚拟地址空间划分为固定大小的页,称为逻辑页
Paged allocation divides the computer's primary memory into fixed-size units called page frames, and the program's virtual
address space into pages of the same size.
#物理内存划分为固定大小的页帧
The hardware memory management unit(MMU) maps pages to frames.
Usually, with paged memory management, each job runs in its own address space.
逻辑地址分解为逻辑页号P和页内偏移d
逻辑页号=逻辑地址 / 页面大小(整除)
页内偏移=逻辑地址 - P * 页面大小
假设页面大小是2的k次方Byte,则逻辑地址的低k位就是页内偏移,其余位就是逻辑页号
物理地址=物理页帧号 * 页面大小 + d
每个进程都有一个自己的页表,页表存放逻辑页和物理页帧的对应关系
快表整个系统就一个,又叫TLB(translation lookaside buffer)
访问快表的速度比页表的速度快得多,快表是寄存器,里面是访问频次较高的页表项
To speed address translation,we are going to add what is called a translation-lookaside buffer,TLB.
A TLB is part of the chip’s memory-management unit (MMU),and is simply a hardware cache of popular virtual-to-physical
address translations;
https://www.cs.cornell.edu/courses/cs4410/2015su/lectures/lec14-pagetables.html
https://pages.cs.wisc.edu/~remzi/OSTEP/vm-tlbs.pdf
https://pages.cs.wisc.edu/~remzi/OSTEP/vm-paging.pdf
https://en.wikipedia.org/wiki/Memory_management_(operating_systems)