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.

  • 相关阅读:
    mysql数据库基本类型
    常用辅助类【转】
    Java 并发笔记】并发机制底层实现整理[转发]
    关于PROPAGATION_NESTED的理解
    线程数设置
    c# Expression 扩展[转]
    Net定时器 【转载】
    【转】高可用设计-58沈剑
    【转】委托的三种调用示例(同步调用 异步调用 异步回调)
    [coursera OA] acme match
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6214437.html
Copyright © 2011-2022 走看看