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.

Implicit and Explicit Multithreading MULTITHREADING AND CHIP MULTIPROCESSORS的更多相关文章

  1. C++雾中风景5:Explicit's better than implicit.聊聊Explicit.

    关于Explicit还是Implicit一直是编程语言中能让程序员们干起架的争议.那些聪明的老鸟总是觉得Implicit的规则让他们能够一目十行,减少样板代码的羁绊.而很多时候,Implicit的很多 ...

  2. 【转】C#中的implicit 和 explicit

    The implicit and explicit keywords in C# are used when declaring conversion operators. Let's say tha ...

  3. MULTITHREADING AND CHIP MULTIPROCESSORS

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION The most important me ...

  4. implicit和explicit的基本使用

    class MyAge { public int Age { get; set; } public static implicit operator MyAge(int age) { return n ...

  5. C# 自己定义 implicit和explicit转换

    explicit 和 implicit 属于转换运算符,如用这两者能够让我们自己定义的类型支持相互交换explicti 表示显式转换.如从 A -> B 必须进行强制类型转换(B = (B)A) ...

  6. C#之自己定义的implicit和explicit转换

    在类型转换时常会遇到隐式转换和显式转换.那我们自己定义的类型要怎样去定义隐式转换和显式转换?我们来看一段代码 public class Rational { private Int32 _inner_ ...

  7. implicit和 explicit关键字

    implicit 关键字用于声明隐式的用户定义类型转换运算符. 如果可以确保转换过程不会造成数据丢失,则可使用该关键字在用户定义类型和其他类型之间进行隐式转换. class Digit { publi ...

  8. 操作符(运算符)重载 或者叫 二元运算符 operator + 与 转换式操作符 implicit operator explicit operator

    static void Main(string[] args) { rational r1 = new rational(5); rational r2 = new rational(51); rat ...

  9. C#自定义转换(implicit 或 explicit)

    C#的类型转换分为显式转换和隐式转换,显式转换需要自己声明转换类型,而隐式转换由编译器自动完成,无需我们声明,如: //long需要显式转换成int long l = 1L; int i = (int ...

随机推荐

  1. tornado 重定向404(方法不对)

    application = tornado.web.Application(url_wrapper([ (r"", include('app.views.web_services. ...

  2. 【python】类(资料+疑惑)

    1.http://python-china.org/t/77 有关method binding的理解 2.[Python] dir() 与 __dict__,__slots__ 的区别 3.Descr ...

  3. 配置nodejs环境

    一.由于node有多种版本号,每个版本号的API肯定也有些细微的差别,在工作中有可能要经常切换node的版本号,因此可以下载nvm使其来管理node的版本号. 首先下载nvm,官网:https://g ...

  4. NavigationController

    前面的一篇文章<iOS开发16:使用Navigation Controller切换视图>中的小例子在运行时,屏幕上方出现的工具栏就是Navigation Bar,而所谓UINavigati ...

  5. libcpmt.lib 与 msvcprt.lib

    https://msdn.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx

  6. AngularJS SQL 获取数据

    使用PHP从MySQL中获取数据: <!DOCTYPE html> <html> <head> <meta charset="utf-8" ...

  7. c#中文件与二进制流文件的转换

    将文件转换成二进制方法: /// <summary>    /// 将文件转换成二进制    /// </summary>    /// <param name=&quo ...

  8. Knockout.js随手记(2)

    计算属性 konckout.js的API文档,写的极为详细和生动,透过MVVM的运作原理,开发时只需专注于定义ViewModel逻辑,不需耗费心力处理TextBox.Select的onchange.o ...

  9. JS高级程序设计笔记一

    /*设置自定义属性*/ var div=document.querySelector("#div1"); div.setAttribute("title",&q ...

  10. Tomcat中JVM内存溢出及合理配置及maxThreads如何配置(转)

    来源:http://www.tot.name/html/20150530/20150530102930.htm Tomcat本身不能直接在计算机上运行,需要依赖于硬件基础之上的操作系统和一个Java虚 ...