zoukankan      html  css  js  c++  java
  • Swapping

    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.
     
     
  • 相关阅读:
    3373=数据结构实验之查找一:二叉排序树
    3345=数据结构实验之二叉树六:哈夫曼编码
    3341=数据结构实验之二叉树二:遍历二叉树
    3340=数据结构实验之二叉树一:树的同构
    3362=数据结构实验之图论六:村村通公路
    Object处理方法返回值
    ASPCTJ
    myBatis 多对多
    初识MyBatis
    测试题
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6216601.html
Copyright © 2011-2022 走看看