Concurrency and Parallelism

This concludes our initial whirlwind tour of systems. An important idea to take
away from this discussion is that a system is more than just hardware. It is a
collection of intertwined hardware and systems software that must cooperate in
order to achieve the ultimate goal of running application programs.

**

Concurrency and Parallelism

**
Throughout the history of digital computers, two demands have been constant
forces driving improvements: we want them to do more, and we want them to
run faster. Both of these factors improve when the processor does more things at
once.We use the term concurrency to refer to the general concept of a system with
multiple, simultaneous activities, and the term parallelism to refer to the use of
concurrency to make a system run faster. Parallelism can be exploited at multiple
levels of abstraction in a computer system.We highlight three levels here, working
from the highest to the lowest level in the system hierarchy.

Thread-Level Concurrency
Building on the process abstraction, we are able to devise systems where multiple
programs execute at the same time, leading to concurrency. With threads, we
can even have multiple control flows executing within a single process. Support
for concurrent execution has been found in computer systems since the advent
of time-sharing in the early 1960s. Traditionally, this concurrent execution was
only simulated, by having a single computer rapidly switch among its executing
processes, much as a juggler keeps multiple balls flying through the air. This form
of concurrency allows multiple users to interact with a system at the same time,
such as when many people want to get pages from a single Web server. It also
allows a single user to engage in multiple tasks concurrently, such as having a
Web browser in one window, a word processor in another, and streaming music
playing at the same time. Until recently, most actual computing was done by a
single processor, even if that processor had to switch among multiple tasks. This
configuration is known as a uniprocessor system.
When we construct a system consisting of multiple processors all under the
control of a single operating system kernel, we have a multiprocessor system.
Such systems have been available for large-scale computing since the 1980s, but
they have more recently become commonplace with the advent of multi-core
processors and hyperthreading. Figure 1.16 shows a taxonomy of these different
processor types.
在这里插入图片描述
Multi-core processors have several CPUs (referred to as “cores”) integrated
onto a single integrated-circuit chip. Figure 1.17 illustrates the organization of an
Intel Core i7 processor, where the microprocessor chip has four CPU cores, each
with its own L1 and L2 caches but sharing the higher levels of cache as well as the
interface to main memory. Industry experts predict that they will be able to have
dozens, and ultimately hundreds, of cores on a single chip.
在这里插入图片描述
Hyperthreading, sometimes called simultaneous multi-threading, is a technique
that allows a single CPU to execute multiple flows of control. It involves
having multiple copies of some of the CPU hardware, such as program counters
and register files, while having only single copies of other parts of the hardware,
such as the units that perform floating-point arithmetic. Whereas a conventional processor requires around 20,000 clock cycles to shift between different threads,
a hyperthreaded processor decides which of its threads to execute on a cycleby-
cycle basis. It enables the CPU to make better advantage of its processing
resources. For example, if one thread must wait for some data to be loaded into
a cache, the CPU can proceed with the execution of a different thread. As an example,
the Intel Core i7 processor can have each core executing two threads, and
so a four-core system can actually execute eight threads in parallel.
The use of multiprocessing can improve system performance in two ways.
First, it reduces the need to simulate concurrency when performing multiple tasks.
As mentioned, even a personal computer being used by a single person is expected
to perform many activities concurrently. Second, it can run a single application
program faster, but only if that program is expressed in terms of multiple threads
that can effectively execute in parallel. Thus, although the principles of concurrency
have been formulated and studied for over 50 years, the advent of multi-core
and hyperthreaded systems has greatly increased the desire to find ways to write
application programs that can exploit the thread-level parallelism available with
the hardware. Chapter 12 will look much more deeply into concurrency and its
use to provide a sharing of processing resources and to enable more parallelism
in program execution.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值