文档介绍:Operating System
Lecture Three
Process Description & Control
School of Software
Nanjing University
1
本主题教学目标
掌握进程的概念
掌握进程的状态、进程的挂起,以及队列实现模型
掌握操作系统的控制结构
掌握进程描述与控制的数据结构
掌握处理机模式的概念
掌握进程创建、模式切换、进程切换、进程队列、进程原语等进程实现的原理
了解操作系统的执行模型
了解SVR4的进程管理
2
Process Description and Control
Process States
Process
Two-State Process Model
Three-State Process Model
Five-State Process Model
Process Suspend
Process Description
Process Control
Examples: Process
3
Multi-programming …
两道程序同时工作
处理器利用率: (52+42)/(78+52+20)≈63%
78
输入机
处理器
磁带机
130
150
228
280
300
378
430
450
时间
磁带机
打印机
20
62
170
320
4
多道程序设计的特征
多道程序共享处理器、内存等资源,多道程序交替利用处理器时间,提高处理器与外设,外设与外设之间的并行度。
运行环境:封闭开放
执行轨迹:顺序并发, 确定不确定
资源占用:独占共享
系统需要一个能描述程序动态执行过程的单位。
进程
5
Major Requirements of an OS
Interleave the execution of several processes to maximize processor utilization while providing reasonable response time
Allocate resources to processes
Support munication(IPC) and user creation of processes
6
Manage Execution of Applications
Resources made available to multiple applications
Processor is switched among multiple applications
The processor and I/O devices can be used efficiently
7
Process
一个正在执行的程序。
一个正在计算机上执行的程序实例。
能分配给处理并由处理器执行的实体。
一个具有以下特征的活动单元:一组指令序列的执行、一个当前活动和相关的系统资源的集合。
8
Process
Also called a task
Execution of an individual program
Can be traced
list the sequence of instructions that execute
9
The Definition of Process
进程是一个可并发执行的具有独立功能的程序关于某个数据集合的一次执行过程。(1978年全国操作系统学术会议)
10