[Chapter 3 Process]Practice 3.4 Describe what happens when a context switch occurs if the new context is already loaded into one of the register sets.
3.4 The Sun UltraSPARC processor has multiple register sets. Describe what happens when a context switch occurs if the new context is already loaded into one of the register sets. What happens if the new context is in memory rather than in a register set and all the register sets are in use?
答案: 因为暂时还没找到多寄存器集的处理器在上下文切换时的工作原理, 所以无法好好理解此问题。 只能根据自己的猜测来回答此题。
在单寄存器集处理器中, 上下文切换时需要先将当前进程的上下文保存到PCB中, 并读取下一个进程的上下文。多寄存器集, 进行上下文切换时, 如果新的上下文早已经读取到一个新的寄存器集中, 处理器应该会把切换到这个新的寄存器集, 使用新的上下文继续执行进程, 旧的寄存器集同时会将上下文信息保存到其进程PCB中, 新的上下文的读取和旧的上下文的保存应该是并发进行的, 所以context switch的时间开销要比单寄存器集少很多。
如果新的上下文是在内存中而不是寄存器里, 那么在读取新的上下文时的时间开销要比读取寄存器里的上下文时间开销大。
扩展:
上下文包含CPU寄存器里的值, 进程状态, 内存管理信息。 上下文并不等于PCB, 它只是由PCB中的部分信息构成。
要完成上下文的奇幻, 内核要将当前执行的进程上下文存储到当前进程在内存中的PCB中, 然后将新进程的上下文从其内存的PCB中读取到CPU寄存器中。
[Chapter 3 Process]Practice 3.4 Describe what happens when a context switch occurs if the new context is already loaded into one of the register sets.的更多相关文章
- [Chapter 3 Process]Practice 3.9 Describe the actions token by a kernel to content-switch between processes.
3.9 Describe the actions token by a kernel to content-switch between processes. 答案: 内核在进行进程上下文切换时, 首 ...
- [Chapter 3 Process]Practice 3.8: Describe the differences among short-term, medium-term, long-term scheduling
3.8 Describe the differences among short-term, medium-term, and longterm scheduling. 答案: 长期调度决定哪些进程进 ...
- [Chapter 3 Process]Practice 3.12 Including the initial parent process, how many processes are created by the program shown in Figure 3.32?
3.12 Including the initial parent process, how many processes are created by the program shown in Fi ...
- [Chapter 3 Process]Practice 3.5 When a process creates a new process using the fork() operation
3.5 When a process creates a new process using the fork() operation, which of the following state is ...
- [Chapter 3 Process]Practice 3.3 Discuss three major complications that concurrent processing adds to an operating system.
3.3 Original version of Apple's mobile iOS operating system provied no means of concurrent processi ...
- [Chapter 3 Process]Practice 3.2 Including the initial parent process, how many processes are created by the program shown in Figure?
3.2 Including the initial parent process, how many processes are created by the program shown in Fig ...
- [Chapter 3 Process]Practice 3.1 相关知识:进程创建、fork函数
3.1 Using the program shown in the Figure3.30, explain what the output will be at LINE A 答案:LINE A 处 ...
- 查看上下文切换的多的进程(find which process take the most context switch)
这是原文链接http://serverfault.com/questions/190049/find-out-which-task-is-generating-a-lot-of-context-swi ...
- .NET:CLR via C# Thread Basics
A thread is a Windows concept whose job is to virtualize the CPU. Thread Overhead Thread kernel obje ...
随机推荐
- oracle start with connect by prior 递归查询
Oracle中的select语句可以用start with...connect by prior子句实现递归查询,connect by 是结构化查询中用到的, 其基本语法是: select ... f ...
- JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException
新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...
- set JAVA_HOME in RHEL/CentOS
3.3. Install OpenJDK on Red Hat Enterprise Linux Introduction OpenJDK is one of many Java Developmen ...
- LCD1602写自定义字符的Verilog源码
开发工具:Quartus II 9.1: 仿真软件:Questa Sim 10.0c: 硬件平台:Terasic DE2-115(EP2C35F672C6): 外设:hd44780控制器lcd1602 ...
- iOS 关于僵尸对象和僵尸指针的那些事儿
引言 提到僵尸就感到一种恐怖,大家都知道“僵尸”是没有生命的,但是它确实是一种存在的类似生命体的一种生物.哈哈,当然本文的重点不是讨论“僵尸”,而是有关于ios当中经常遇到的僵尸指针(Zombie P ...
- js 小工具-- 获取主机名
<script type="text/javascript"> function getHostName(url) { var host = "null&qu ...
- 2.openssl rsa/pkey
分别是RSA密钥的处理工具和通用非对称密钥处理工具.它们用法基本一致,所以只介绍openssl rsa. [root@xuexi tmp]# man rsa NAME rsa - RSA key pr ...
- 怎么提高ArcSDE 写入地理数据库的效率
link: http://blog.csdn.net/linghe301/article/details/20900615 2014-03-14 09:20 2686人阅读 评论(6) 收藏 举报 ...
- codeforce div 377
#include <bits/stdc++.h> using namespace std; #define pb push_back #define lb lower_bound #def ...
- jquery 找不到live方法解决
http://stackoverflow.com/questions/15573645/typeerror-live-is-not-a-function