- 调度
- context switch: save context(PCB), restore context(PCB). 开销
- 如何维护各个进程的状态:PCB + 队列(job队列,ready 队列,I/O设备队列)
- who is the next to run? :
-
- CPU调度器(短期100ms): good repsonse time
- 接纳调度器(长期1+min): the degree of multiprogramming and mix of cpu- and i/o -bound processes
- 内存调度器(中期):reduce the degree of multiprogramming according to available memory
- 进程操作
- 创建:父子进程。fork, createProcess
- 进程协作:生产者、消费者问题
- interprocess communication IPC[系统调用]
- 共享内存[独自管理]【关键点:停止生产和消费的条件。】
- 终止
- IPC: pipe 管道, FIFO
- 匿名管道:父子进程,单工 (0 for read, 1 for write)
- 具名管道:任意进程,单、双工