1、 How does a TLB (translation-lookaside buffer) speed the process of address translation? The two memory access problem can be solved by the use of a special fast-lookup hardware cache called associative memory or translation look-aside buffers ``` TLB(翻译旁路缓冲区)如何加快地址转换过程? 使用一种特殊的快速查找硬件高速缓存(称为关联内存或翻译查找缓冲区),可以解决两个内存访问问题 ``` 1、 What is deadlock? Please illustrate the cause of deadlock and the necessary conditions for deadlock. A set of blocked processes each holding a resource and waiting to acquire a resource held by another blocked process in the set **Mutual exclusion:** only one process at a time can use a resource **Hold and wait:** a process holding at least one resource is waiting to acquire additional resources held by other processes **No preemption:** a resource can be released only voluntarily by the process holding it, after that process has completed its task **Circular wait:** there exists a set {*P*0, *P*1, …, *P*n} of waiting processes such that *P*0 is waiting for a resource that is held by *P*1, *P*1 is waiting for a resource that is held by *P*2, …, *Pn*–1 is waiting for a resource that is held by *P*n, and *P*n is waiting for a resource that is held by *P*0. ``` 7、 什么是死锁?请说明死锁的原因和死锁的必要条件。 一组阻塞进程,每个进程都持有一个资源,并等待获取该组中另一个阻塞进程持有的资源 互斥:一次只能有一个进程使用资源 持有和等待:持有至少一种资源的进程正在等待获取其他进程持有的其他资源 无抢占:只有在持有资源的进程完成任务后,该进程才能自愿释放资源 循环等待:存在一组 {P0、P1、......、Pn} 等待进程,其中 P0 等待 P1 持有的资源,P1 等待 P2 持有的资源,......,Pn-1 等待 Pn 持有的资源,Pn 等待 P0 持有的资源。 ``` 1、 In the RR scheduling algorithm, how does the time slice value (quantum) of the system influence on the system’ performance? The value of time slice is related to the efficiency of computer system and user satisfaction, so the value of time slice should be determined according to the response time required by the process and the number of processes entering the system. If the system is required to respond quickly, the time slice is smaller, which reduces the turnaround time and allows the process to respond as quickly as possible. If the number of processes is small, the time slice can be larger, which can reduce the times of process scheduling and improve the efficiency of the system. However, it should be noted that when the time slice value is too large, the algorithm degenerates into a first-come-first-served algorithm. If the time slice value is too small, it will increase system overhead. Generally, 80% of CPU bursts should be shorter than time quantum ``` 4、 在 RR 调度算法中,系统的时间片值(量子)对系统性能有何影响? 时间片的值与计算机系统的效率和用户满意度有关,因此应根据进程所需的响应时间和进入系统的进程数量来确定时间片的值。 如果要求系统快速响应,则时间片越小越好,这样可以缩短周转时间,让流程尽快响应。如果流程数量少,时间片可以大一些,这样可以减少流程调度的时间,提高系统的效率。 但需要注意的是,当时间片值过大时,算法会退化为先到先得算法。如果时间片值太小,则会增加系统开销。一般来说,80% 的 CPU 突发应短于时间量子 ``` 1、 What are the two methods for implementing the LRU Page Replacement algorithm? Describe their characteristics. **Counter implementation:** Every page table entry has a counter; every time page is referenced through this entry, copy the clock into the counter When a page needs to be replaced, look at the counters to find smallest value Search through table needed **Stack implementation:** Keep a stack of page numbers in a double link form: **Page referenced:** move it to the top, the most recently used page is always at the top of the stack and the least recently used page is always at the bottom requires 6 pointers to be changed at worse But each update more expensive No search for replacement ``` 12、实现 LRU 页面替换算法的两种方法是什么?描述它们的特点。 计数器实现: 每个页表条目都有一个计数器;每次通过该条目引用页面时,将时钟复制到计数器中 需要替换页面时,查看计数器,找出最小值 搜索所需的页表 堆栈实现: 以双链接形式保存页码堆栈: 页码引用: 将其移至顶部,最近使用的页面始终位于堆栈顶部,最近使用最少的页面始终位于堆栈底部 更糟的是,需要更改 6 个指针 但每次更新成本更高 无法搜索替换 ```