COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

Referring back to Figure 8.11, we have discussed three types of queues: the long-
term queue of requests for new processes, the short-term queue of processes ready
to use the processor, and the various I/O queues of processes that are not ready to
use the processor. Recall that the reason for this elaborate machinery is that I/O
activities are much slower than computation and therefore the processor in a uni-
programming system is idle most of the time.
But the arrangement in Figure 8.11 does not entirely solve the problem. It is
true that, in this case, memory holds multiple processes and that the processor can
move to another process when one process is waiting. But the processor is so much
faster than I/O that it will be common for all the processes in memory to be waiting
on I/O. Thus, even with multiprogramming, a processor could be idle most of the
time.
What to do? Main memory could be expanded, and so be able to accommo-
date more processes. But there are two flaws in this approach. First, main memory
is expensive, even today. Second, the appetite of programs for memory has grown
as fast as the cost of memory has dropped. So larger memory results in larger proc-
esses, not more processes.
 
 
Another solution is swapping, depicted in Figure 8.12. We have a long-term
queue of process requests, typically stored on disk. These are brought in, one at a
time, as space becomes available. As processes are completed, they are moved out
of main memory. Now the situation will arise that none of the processes in memory
are in the ready state (e.g., all are waiting on an I/O operation). Rather than remain
idle, the processor swaps one of these processes back out to disk into an intermediate
queue.
This is a queue of existing processes that have been temporarily kicked out
of memory. The OS then brings in another process from the intermediate queue, or
it honors a new process request from the long-term queue. Execution then contin-
ues with the newly arrived process.
Swapping, however, is an I/O operation, and therefore there is the potential
for making the problem worse, not better. But because disk I/O is generally the
fastest I/O on a system (e.g., compared with tape or printer I/O), swapping will usu-
ally enhance performance. A more sophisticated scheme, involving virtual memory,
improves performance over simple swapping. This will be discussed shortly. But
first, we must prepare the ground by explaining partitioning and paging.
 
 

Swapping的更多相关文章

  1. [POJ 1674] Sorting by Swapping

    Sorting by Swapping Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9514   Accepted: 50 ...

  2. Case swapping

    Case swapping Description: Given a string, swap the case for each of the letters. e.g. CodEwArs --&g ...

  3. Matrix Swapping II(求矩阵最大面积,dp)

    Matrix Swapping II Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  4. CDH集群频繁告警(host频繁swapping)

    最近CDH集群频繁告警,原因是某些host频繁swapping,极大影响了集群的性能. 后来发现有个设置(/proc/sys/vm/swappiness)需要修改,默认值60 Setting the ...

  5. UVa 299 - Train Swapping

    题目大意:给n个数的一个序列,通过交换相邻的两个数使得这n个数按照从小到大的顺序排列. Inversion index problem: count how many swaps are needed ...

  6. Hot swapping

    83. Hot swapping83.1 Reload static contentThere are several options for hot reloading. The recommend ...

  7. 【Devops】【docker】【CI/CD】Jenkins源代码管理 添加gitlab项目地址,报错Failed to connect to repository : Error performing command: ls-remote -h git@192.168.92.130:8090/root/swapping.git HEAD

    Jenkins源代码管理 添加gitlab项目地址 报错如下: Failed to connect to repository : Error performing command: ls-remot ...

  8. 【docker-compose】使用docker-compose启动spring-boot+mysql,服务内连数据库报错:create connection SQLException, url: jdbc:mysql://mysql:33061/swapping?useSSL=false&useUnicode=true&characterEncoding=UTF-8, errorCode 0,

    完整配置在这里, https://www.cnblogs.com/sxdcgaq8080/p/10070948.html 启动报错如下: 2018-12-05 01:04:05.569 ERROR 1 ...

  9. Swapping eth0 and eth1 on OK335xS board

    /******************************************************************************* * Swapping eth0 and ...

随机推荐

  1. Type InvokeMember()用法简介

    举例: Type tDate = typeof(System.DateTime); Object result = tDate.InvokeMember("Now", Bindin ...

  2. jetty与hessian结合

    Hessian是由caucho提供的一个基于binary-RPC实现的远程通讯library,支持多种语言,包括c++,java,c#等,还支持flash/flex     Jetty 是一个开源的s ...

  3. How to enable logging

    转自:https://www.chromium.org/for-testers/enable-logging How to enable logging To enable logging, laun ...

  4. 在Linux中创建静态库.a和动态库.so

    转自:http://www.cnblogs.com/laojie4321/archive/2012/03/28/2421056.html 在Linux中创建静态库.a和动态库.so 我们通常把一些公用 ...

  5. C语言位运算详解(转载)

    转载自:http://www.cnblogs.com/911/archive/2008/05/20/1203477.html 位运算是指按二进制进行的运算.在系统软件中,常常需要处理二进制位的问题.C ...

  6. 最短路(Floyd_Warshall) POJ 2253 Frogger

    题目传送门 /* 最短路:Floyd算法模板题 */ #include <cstdio> #include <iostream> #include <algorithm& ...

  7. javascript第三弹——数组

    什么是数组 数组是值的有序集合.每个值叫做元素,每个元素在数组中都有数字位置编号,也就是索引.JS中的数组是弱类型的,数组中可以含有不同类型的元素.数组元素甚至可以是对象或其它数组.数组的长度是动态的 ...

  8. 泛型,动态创建List<T> (转摘)

    第一种: static void Main()        {            object intList = MakeList(typeof(int), 1, 2, 3);         ...

  9. C#设计模式——抽象工厂模式(原文转自:http://blog.jobbole.com/78059/)

    一.引言 在上一专题中介绍了工厂方法模式,工厂方法模式是为了克服简单工厂模式的缺点而设计出来的,简单工厂模式的工厂类随着产品类的增加需要增加额外的代码),而工厂方法模式每个具体工厂类只完成单个实例的创 ...

  10. li:hover在ie6下失效的解决方案

    li:hover在ie6下是无效的,它只在ie7以下版本有效.要解决这个问题有两个解决方法.一个是用js来解决,但是这种方法我不喜欢,因为它必需把js代码和css代码都放在html文件中.第二种是在每 ...