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.

最新文章

  1. 51. 顺时针打印矩阵[print matrix in clockwise direction]
  2. Spring BeanNameAutoProxyCreator 与 ProxyFactoryBean区别
  3. 红帽RHEL7版本RHCE认证学习及考试经历
  4. 学习笔记008之Task
  5. pushd
  6. uva 307
  7. BZOJ 2763: [JLOI2011]飞行路线 最短路
  8. 【转】 UIButton上使用UIEdgeInsetsMaketitle跟图片对齐
  9. error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
  10. intent.putExtra()方法参数详解
  11. Postman 测试web接口(推荐)
  12. Metadata Service 一个最简单的应用 - 每天5分钟玩转 OpenStack(164)
  13. CF 375D. Tree and Queries【莫队 | dsu on tree】
  14. python数据类型一:字符串
  15. 2018-2019-2 20175311 实验一《Java开发环境的熟悉》实验报告
  16. app的创建和注册
  17. eclipse项目名称后面括号里的名称和项目名称不一样
  18. 2015-10-13 jQuery5实例
  19. 【RabbitMQ】——5种队列(转)
  20. html active属性

热门文章

  1. 配置ngnix
  2. IIS跳转html页面自动识别是PC端还是手机端
  3. 使用EmBitz开发STM32项目的环境配置
  4. 会话控制:Cookie和session
  5. 简单快捷好用的vim配置和终端配置推荐
  6. 【Javascript】解决Ajax轮询造成的线程阻塞问题(过渡方案)
  7. C# 执行文件的根目录 (转)
  8. 微软的R语言发行版本MRO及开发工具RTVS
  9. CozyRSS开发记录3-标题栏再加强
  10. 在 windows 环境下安装 redislive