[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 ...
随机推荐
- [IIS]IIS扫盲(六)
一:聊天室 聊天室的种类有很多,免费的聊天室也有很多,这些聊天室的ASP源码从网上都可以下载得到,我们就以毒爱聊天室为版本来教大家做.好,大家先下载毒爱聊天室,当然,本站软件下载里就有下载,下载的是 ...
- java测试题总结
1.Struts2处理来自多个页面的同一个Action请求,那么它们是不是同一个action. struts2中每个请求都是独立的.每一次请求都会去new一个新的action,所有写在action中的 ...
- ASPxSpinEdit 控件的三元判断
方法一:<dx:ASPxSpinEdit ID=" DisplayFormatString="c" Width="100px"></ ...
- CSS基础篇
写的不错,收藏 http://www.cnblogs.com/suoning/p/5625582.html
- Python之路【第十五篇】:Web框架
Python之路[第十五篇]:Web框架 Web框架本质 众所周知,对于所有的Web应用,本质上其实就是一个socket服务端,用户的浏览器其实就是一个socket客户端. 1 2 3 4 5 6 ...
- Linux网络常用指令
5.1 网络参数设定使用的指令 ifconfig 查询 设定网络卡与 IP 网域等相关参数: ifup, ifdown 这两个档案是 script,透过更简单的方式来启动网络接口: route 查 ...
- 在django中使用自定义标签实现分页功能
效果演示: github地址:https://github.com/mncu/django_projects/tree/master/django_projects/pagination_test 本 ...
- MFC CFileDialog用法例子。
Set it to TRUE to construct a File Open dialog box. Set it to FALSE to construct a File Save As dia ...
- VC++ 关于 ON_UPDATE_COMMAND_UI 相关的作用.
ON_COMMAND_RANGE(ID_SORTING_GROUPBYTYPE, ID_SORTING_SORTBYACCESS, OnSort) ON_UPDATE_COMMAND_UI_RANGE ...
- textview 多行 省略号
TextView自带的可以通过 android:ellipsize="end" android:singleLine="true"实现单行省略, 多行显示: ...