资源预览内容
第1页 / 共21页
第2页 / 共21页
第3页 / 共21页
第4页 / 共21页
第5页 / 共21页
第6页 / 共21页
第7页 / 共21页
第8页 / 共21页
第9页 / 共21页
第10页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
下次适应分配算法某系统采用此算法,假定在新的20k、10k和 5k的请求到来之前内存分配情况如下图所 示,试求各个请求将分配到的内存起始地 址。已 使 用 10未 使 用 10已 使 用 20未 使 用 30已 使 用 10未 使 用 5已 使 用 30未 使 用 20已 使 用 10未 使 用 15已 使 用 20未 使 用 20多重页表某计算机有32位虚拟地址空间,且页大小为 1024字节.每个页表长4字节,因为每个页 表必须包含在一页中,所以使用多级页表, 问一共需要多少级?answer页表每页包含1024/4=28个页表项.页大小为 210.所以用32-10=22位指定页号.每一级页 表能处理22位中的8位,总共需要3级,其中 两级页表有28个页表项,另一级仅有26个页 表项.LRU算法 有一个请求页式系统,整数占4字节,页大小为 256字节,使用LRU页面替换算法,每个进程 分配3个页框.某进程执行如下代码.int a =new int200200;int i =0;int j=0; While (i+6时系统也会出现死锁。而n=5时,最糟情况下也会有P1P5 此时可化简为完全可化简图,不死锁。同理1r(c) sqr(d)s=qr(e)q几乎为零(a)进程将会一直运行直至阻塞对于每 次循环,完成r个时间单元的有效工作需 要s个时间单元的开销,CPU的效率是r/( r+s).(b)由于进程会一直运行直到阻塞,所以 CPU的效率和(a)一样 (c)需要的切换次数是r/q,花费在切换上 的时间是sr/q,CPU的效率是r/(r+sr/q) (d)与(C)相同,但在这里q=s,从而为0.5. (f)从(C)中可得,当q接近于零时,CPU 的效率也接近于零449页 12.1450页 12.51. Contiguous. a. Divide the logical address by 512 with X and Y the resulting quotient and remainder respectively. Add X to Z to obtain the physical block number. Y is the displacement into that block. b. 1 2. Linked. a. Divide the logical physical address by 511 with X and Y the resulting quotient and remainder respectively. Chase down the linked list (getting X + 1 blocks). Y + 1 is the displacement into the last physical block. b. 43. Indexed.a. Divide the logical address by 512, with X and Y the resulting quotient and remainder, respectively. Get the index block into memory. Physical block address is contained in the index block at location X. Y is the displacement into the desired physical block. b. 2313页 9.5a. First-fit:212K is put in 500K partition;417K is put in 600K partition;112K is put in 288K partition (new partition 288K = 500K - 212K); 426K must wait b. Best-fit: 212K is put in 300K partition; 417K is put in 500K partition112K is put in 200K partition; 426K is put in 600K partition c. Worst-fit: 212K is put in 600K partition; 417K is put in 500K partition112K is put in 388K partition 426K must wait In this example, Best-fit turns out to be the best.
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号