调度算法- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
时间
突发时间 Burst time
通常,我们忽略I/O时间,只考虑进程的CPU时间。因此,突发时间是进程在CPU上执行所花费的总时间。
Arrival Time
到达时间是流程进入就绪状态并为其执行做好准备的时间。
Exit time
退出时间是进程完成执行并退出系统的时间。
Response Time
响应时间是进程处于就绪状态并第一次使用CPU的时间。
Response time = Time at which the process gets the CPU for the first time -
Arrival time
Waiting Time
等待时间是进程在就绪状态下等待CPU的总时间。
Waiting time = Turnaround time - Burst time
周转时间Turnaround time
周转时间是流程从第一次进入准备状态到完成所花费的总时间。
Turnaround time = Burst time + Waiting time
or
Turnaround time = Exit time - Arrival time
Throughput
吞吐量是一种计算CPU效率的方法。它可以定义为CPU在给定时间内执行的进程数。
e.g
For example, let's say, the process P1 takes 3 seconds for execution, P2 takes 5
seconds, and P3 takes 10 seconds. So, throughput, in this case, the throughput will
be (3+5+10)/3 = 18/3 = 6 seconds.
Length of Next CPU Burst
要执行的进程的爆发时间取到目前为止所有已执行进程的平均值。
公式:
各种调度以及例题
Shortest-Job-First (SJF) Scheduling
Priority Scheduling
Round Robin (RR) Scheduling
FCFS
Shortest Job First
内存管理策略- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TLB分页系统
求内存大小/位数/寻址
If the size of logical address space is 2 to the power of m, and a page size is 2 to the power of n addressing units, then the high order m-n bits of a logical address designate the page number, and the n low order bits designate the page offset.
如果逻辑地址空间的大小是2的m次方,而页面大小是2的n次方寻址单元,那么逻辑地址的高阶m-n位表示页码,而低阶n位表示页面偏移量。
内存分配
计算缺页次数
FIFO
最优算法
LRU算法
硬盘传输
磁盘调度
先到先服务FCFS
SSTF
SCAN
从低到高
从高到低
C-SCAN
LOOK
C-LOOK