zoukankan      html  css  js  c++  java
  • Implicit and Explicit Multithreading MULTITHREADING AND CHIP MULTIPROCESSORS

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

    The concept of thread used in discussing multithreaded processors may or may not
    be the same as the concept of software threads in a multiprogrammed operating
    system. It will be useful to define terms briefly:
    • Process: An instance of a program running on a computer. A process embod-
    ies two key characteristics:
    — Resource ownership: A process includes a virtual address space to hold the
    process image; the process image is the collection of program, data, stack,
    and attributes that define the process. From time to time, a process may
    be allocated control or ownership of resources, such as main memory, I/O
    channels, I/O devices, and files.
    — Scheduling/execution: The execution of a process follows an execution
    path (trace) through one or more programs. This execution may be inter-
    leaved with that of other processes. Thus, a process has an execution state
    (Running, Ready, etc.) and a dispatching priority and is the entity that is
    scheduled and dispatched by the operating system.

    • Process switch: An operation that switches the processor from one process to
    another, by saving all the process control data, registers, and other information
    for the first and replacing them with the process information for the second.

    • Thread: A dispatchable unit of work within a process. It includes a processor
    context (which includes the program counter and stack pointer) and its own data
    area for a stack (to enable subroutine branching). A thread executes sequen-
    tially and is interruptible so that the processor can turn to another thread.
    • Thread switch: The act of switching processor control from one thread to an-
    other within the same process. Typically, this type of switch is much less costly
    than a process switch.

    Thus, a thread is concerned with scheduling and execution, whereas a process
    is concerned with both scheduling/execution and resource ownership. The multi-
    ple threads within a process share the same resources. This is why a thread switch
    is much less time consuming than a process switch. Traditional operating systems,
    such as earlier versions of UNIX, did not support threads. Most modern operating
    systems, such as Linux, other versions of UNIX, and Windows, do support thread.
    A distinction is made between user-level threads, which are visible to the applica-
    tion program, and kernel-level threads, which are visible only to the operating sys-
    tem. Both of these may be referred to as explicit threads, defined in software.
    All of the commercial processors and most of the experimental processors so
    far have used explicit multithreading. These systems concurrently execute instruc-
    tions from different explicit threads, either by interleaving instructions from dif-
    ferent threads on shared pipelines or by parallel execution on parallel pipelines.
    Implicit multithreading refers to the concurrent execution of multiple threads
    extracted from a single sequential program. These implicit threads may be defined
    either statically by the compiler or dynamically by the hardware. In the remainder
    of this section we consider explicit multithreading.

    2
    The term context switch is often found in OS literature and textbooks. Unfortunately, although most of
    the literature uses this term to mean what is here called a process switch, other sources use it to mean a
    thread switch. To avoid ambiguity, the term is not used in this book.

  • 相关阅读:
    负载均衡软件LVS 三种实现模式对比
    论文学习笔记:High-level pattern-based classification via tourist
    论文学习笔记:A Network-Based High Level Data Classification
    第四章--度相关性和社团结构(复杂网络学习笔记)
    第三章--网络基本拓扑性质(复杂网络学习笔记)
    第二章--网络与图(复杂网络学习笔记)
    神经网咯基础-deeplearning.ai【笔记】
    前端Jquery-Ajax跨域请求,并携带cookie
    Django中解决跨域请求问题
    1- 基本概念(复杂网络学习笔记)
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6253762.html
Copyright © 2011-2022 走看看