zoukankan      html  css  js  c++  java
  • PROCESS STATES

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

    To understand the operation of the short-term scheduler, we
    need to consider the concept of a process state. During the lifetime of a process,
    its status will change a number of times. Its status at any point in time is referred to
    as a state. The term state is used because it connotes that certain information exists
    that defines the status at that point. At minimum, there are five defined states for a
    process (Figure 8.7):

    • New: A program is admitted by the high-level scheduler but is not yet ready
    to execute. The OS will initialize the process, moving it to the ready state.
    • Ready: The process is ready to execute and is awaiting access to the processor.
    • Running: The process is being executed by the processor.
    • Waiting: The process is suspended from execution waiting for some system
    resource, such as I/O.
    • Halted: The process has terminated and will be destroyed by the OS.

    For each process in the system, the OS must maintain information indicat-
    ing the state of the process and other information necessary for process execution.
    For this purpose, each process is represented in the OS by a process control block
    (Figure 8.8), which typically contains

    • Identifier: Each current process has a unique identifier.
    • State: The current state of the process (new, ready, and so on).
    • Priority: Relative priority level.
    • Program counter: The address of the next instruction in the program to be
    executed.
    • Memory pointers: The starting and ending locations of the process in memory.
    • Context data: These are data that are present in registers in the processor
    while the process is executing, and they will be discussed in Part Three. For
    now, it is enough to say that these data represent the “context” of the process.
    The context data plus the program counter are saved when the process leaves
    the running state. They are retrieved by the processor when it resumes execu-
    tion of the process.

    • I/O status information: Includes outstanding I/O requests, I/O devices (e.g., tape
    drives) assigned to this process, a list of files assigned to the process, and so on.
    • Accounting information: May include the amount of processor time and clock
    time used, time limits, account numbers, and so on.

    When the scheduler accepts a new job or user request for execution, it creates
    a blank process control block and places the associated process in the new state.
    After the system has properly filled in the process control block, the process is
    transferred to the ready state.

  • 相关阅读:
    FZU 2104 Floor problem (水题)
    POJ 1797 Heavy Transportation (最短路变形)
    ZOJ 3708 Density of Power Network (水题)
    POJ 2488 A Knight's Journey (DFS)
    HDU 1198 Farm Irrigation (并查集)
    HDU 1052 Tian Ji -- The Horse Racing (贪心)
    HDU 1598 find the most comfortable road (并查集||最短路)
    poj 2533 Longest Ordered Subsequence(最长上升子序列)
    hdu 2025 查找最大元素 (水)
    hdu 5142 NPY and FFT(水)
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6214437.html
Copyright © 2011-2022 走看看