Professional Documents
Culture Documents
Morgan Kauffman, USA McGraw Hill, India China Machine Press, China
9.1 1
Concurrent Computing- Thread Programming Manjrasoft
IBM Power Systems
2
Unit Objectives Manjrasoft
IBM Power Systems
• Advances in hardware technologies led to the creation of multi- core systems, which
have made possible the delivery of high-throughput computations, even in a single
computer system.
4
Parallelism for single machine computation Manjrasoft
IBM Power Systems
5
Parallelism for single machine computation
Contd… Manjrasoft
IBM Power Systems
7
Parallelism for single machine computation
Contd… Manjrasoft
IBM Power Systems
• Multicore systems are composed of a
single processor that features multiple To Memory
processing cores that share the memory.
• Each core has generally its own L1 cache,
and the L2 cache is common to all the CPU: single
cores, which connect to it by means of a die
shared bus.
• Dual- and quad-core configurations are Cache
Cache L2
L2
quite popular nowadays and constitute the
standard hardware configuration for
commodity computers.
• Architectures with multiple cores are also
available but are not designed for the
commodity market. Cache
Cache L1
L1 Cache
Cache L1
L1 Cache
Cache L1
L1
• Multicore technology has been used not
only as a support for processor design but
also in other devices, such as GPUs and Core 1 Core 2 Core N
network devices, thus becoming a
standard practice for improving
performance.
8
Parallelism for single machine computation
Contd… Manjrasoft
IBM Power Systems
10
Programming Applications with Threads Manjrasoft
IBM Power Systems
11
What is a Thread? Manjrasoft
IBM Power Systems
Process
Process
Shared
Shared Memory
Memory
Main
Main Thread
Thread
Execution
Execution
Timeline
Timeline
Thread
Thread Local
Local Storage
Storage
Instructions
Instructions
(program
(program counter)
counter)
Thread
Thread
Thread
Thread
Thread
Thread
14
Thread APIs Manjrasoft
IBM Power Systems
15
POSIX Threads Manjrasoft
IBM Power Systems
16
POSIX Threads contd… Manjrasoft
IBM Power Systems
17
Threading Support in java and .NET Manjrasoft
IBM Power Systems
20
Unit Objectives – PART 2 Manjrasoft
IBM Power Systems
23
Domain Decomposition Contd… Manjrasoft
IBM Power Systems
24
Domain Decomposition Techniques Manjrasoft
IBM Power Systems
Units of work
Process
Result
a. Embarrassingly parallel
Units of work
Process
Result
b. Inherently sequential
25
Unit Objectives Manjrasoft
IBM Power Systems
26
Functional Decomposition Manjrasoft
IBM Power Systems
28