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. Xcode常用快捷键(持续更新-20160811)

    前言 专门花时间记Xcode快捷键,我觉得没必要,一时记住,不久又会忘记. 用到才记. Xcode常用快捷键 新建 shift + cmd + n     新建项目 cmd + n           ...

  2. PHP-----练习-------租房子-----增删改查,多条件查询

    练习-------租房子-----增删改查,多条件 一 .题目要求: 二 .做法: [1]建立数据库 [2]封装类文件------DBDA.class.php <?php class DBDA ...

  3. 【python】装饰器

    来源:廖雪峰 看了好多次装饰器,发现还是廖老师讲得好,能让我看懂..... 下面是一段装饰器代码 @log def now(): " 它的含义等价于 def now(): " no ...

  4. java学习第二天 回顾运算符

    一.回顾运算符: 补充: 三元运算符. 代码: /* 三目运算符: 三元运算符: 结构: 条件?条件成立的结果 :条件不成立的结果 ; */ class Demo1 { public static v ...

  5. 网络编程之getaddrinfo

    IPv4中使用gethostbyname()函数完成主机名到地址解析,但是该API不允许调用者指定所需地址类型的任何信息,返回的结构只包含 了用于存储IPv4地址的空间.为了解决该问题,IPv6中引入 ...

  6. 原生java 压缩解压zip文件

    import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import ...

  7. 跨域调用webapi

    web端跨域调用webapi   在做Web开发中,常常会遇到跨域的问题,到目前为止,已经有非常多的跨域解决方案. 通过自己的研究以及在网上看了一些大神的博客,写了一个Demo 首先新建一个webap ...

  8. java和c#使用hessian通信

    介绍 hessian主页:http://hessian.caucho.com/ 一个简单的例子学习hessian服务:服务端为Java,客户端为C#. 先要准备好C#和Java的第三方类库:http: ...

  9. CozyRSS开发记录6-继续补全订阅内容栏

    CozyRSS开发记录6-继续补全订阅内容栏 1.订阅内容栏布局 按照之前的原型图,把订阅内容栏分成三块.Xaml如下: 2.照葫芦画瓢,完成头部和列表 头部依然使用ColorZone,右侧再放两个按 ...

  10. [参考]wget下载整站

    wget -m -e robots=off -U "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) Gecko/200 ...