- states: 分为blocked/ready/suspend
- new states:
- suspended process的特点:
- not immediately available
- 当等待event时
- reasons for prrocess suspension(进程挂起):
- swapping
- other os reasons
- iteractive user request
- timing
- parent process …
Process Description
- operating system control structures
process control
- user mode: less privileged
- kernel mode: more privileged, 同样叫做system mode, control mode, 某些instruction/memory只能在high priviledged情况下访问/执行
- mode of execution
- typical function of an OS Kernel
- process management: (…)
- memory management
- I/O management
- support function
- process creation
- process switching
- interrupt
- trap
- supervisor call
- mode switch
- change of process state: 步骤
Threads
- threads 位于共享的process下,属于task或者process的基本单位
- mutitithreading: one process中包含muti threads
- all threads共享states and resources of process
- multithreading的性能优势:
- 创建新的thread远快于创建新的process
- 终止也更快
- 切换也更快
- 加快了communication
- thread functionality
- (…)
- block: 当需要调用时(常见于慢于cpu速度的操作),就会触发block
- unblock
- all the threads of same process共享同一个file/address
Type of threads
- user level and kernel level threads
链接