[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 ...
随机推荐
- Codeforces Round #229 (Div. 2) D
D. Inna and Sweet Matrix time limit per test 1 second memory limit per test 256 megabytes input stan ...
- Karma 5:集成 Karma 和 Angular2
集成 Karma 和 Angular2 我们需要做很多工作,由于需要使用 TypeScript 进行开发,首先需要正确配置 Typescript ,然后正确配置对 Angular2 的引用.还要创建 ...
- VBS基本知识
由于一些需要,开始学习VBS了.此篇文章一直将处于编辑添加状态. 1.VBS简介 VBS 即VBScript(Microsoft Visual Basic Script Editon),是微软开发的一 ...
- sql group by
group by实例 实例一 数据表: 姓名 科目 分数 张三 语文 80 张三 数学 98 张三 英语 65 李四 语文 70 李四 数学 80 李四 英语 90 期望查询结果: 姓名 语文 数学 ...
- IMX6下移植WKxxx驱动
wkXXX.c #include<linux/init.h> #include <linux/module.h> #include <linux/kernel.h> ...
- MFC重载关闭按钮
首先介绍一下WindowProc函数. 函数功能:该函数是一个应用程序定义的函数.它处理发送给窗口的消息.WNDPROC类型定义了一个指向该回调函数的指针.WindowProc是用于应用程序定义函数的 ...
- 通过案例对 spark streaming 透彻理解三板斧之二:spark streaming运行机制
本期内容: 1. Spark Streaming架构 2. Spark Streaming运行机制 Spark大数据分析框架的核心部件: spark Core.spark Streaming流计算. ...
- 【转】linux下skype的安装使用
http://hi.baidu.com/24_jason/item/f85725306c7dbcf5df2221ca Fedora 18/17, CentOS/RHEL/SL 6.3 安装 Skype ...
- 使用Ganglia监控hadoop、hbase
Ganglia是一个监控服务器,集群的开源软件,能够用曲线图表现最近一个小时,最近一天,最近一周,最近一月,最近一年的服务器或者集群的cpu负载,内存,网络,硬盘等指标. Ganglia的强大在于:g ...
- spi controller
http://blog.csdn.net/droidphone/article/details/24353293 http://www.china-cpu.com/supports/article/0 ...