You are on page 1of 18

{Parallel and Distributed Computing}

Multithreading, superscalar
processors, Intel’s hyper threading
Lecture 4

Mr. Ahmad
{ ahmadyark1@gmail.com }
The
Agenda
1. Multithreading

2. Superscalar processors

3. Intel’s hyper threading


Process and
Thread
• Process: A program in execution is called process.

• Thread: is the segment of a process, means a process can have

multiple threads and these multiple threads are contained within

a process.
Process and Thread cont…
Process and Thread cont…

• For example in a word processor, a thread may check spelling and


grammar while another thread processes user input (keystrokes),

while yet another third thread loads images from the hard drive, and

a fourth does periodic automatic backups of the file being edited.


Process and Thread cont…
Comparison Basis Process Thread
Definition A process is a program under execution. A thread is a segment of process.
Weight Heavy weight. Light weight.
Context switching More time required for context switching. Less time required for context switching.
Communication between processes Communication between threads
Communication
requires more time than threads. requires less time than processes .
Resource Processes require more resources than
Threads generally need less resources.
Consumption threads.
Time for creation Processes require more time for creation. Threads require less time for creation.
Time for Processes require more time for Threads require less time for
termination termination. termination.
Process and Thread cont…

A process with two threads of


execution, running on a single
processor.
Multithreadin
g
• In computer architecture, multithreading is the ability of a single
central processing unit (CPU) to provide multiple threads of

execution concurrently, supported by the operating system.

• Multithreading aims to increase utilization of a single core by using

thread-level parallelism.
Multithreading
cont…
• Multithreading allow for multiple requests to be satisfied

simultaneously, without having to service requests sequentially.


Multithreading
cont…
Advantages
1. Responsiveness: If one thread completes its execution, then its
output can be immediately returned.
2. Faster context switch: Context switch time between threads is
lower compared to process context switch. Process context
switching requires more overhead from the CPU.
3. Effective utilization of multiprocessor system: If we have multiple
threads in a single process, then we can schedule multiple threads
on multiple processor. This will make process execution faster.
Multithreading
cont…
Advantages
4. Resource sharing: Resources like code, data, and files can be
shared among all threads within a process. Stack and registers can’t
be shared.
5. Communication: Communication between multiple threads is
easier, as compared to processes.
6. Enhanced throughput of the system: As each threads’ function is
considered as one job, then the number of jobs completed per unit
of time is increased, thus increasing the throughput of the system.
Scalar Processors

• A scalar processor processes only one data item at a time.

• A scalar processor is classified as a SISD processor (Single

Instructions, Single Data) in Flynn's taxonomy.

• A vector processor is a single instruction operates simultaneously on

multiple data items (referred to as "SIMD").


Super Scalar
Processors
• A superscalar processor, on the other hand, executes more than one
instruction during a clock cycle by simultaneously dispatching multiple

instructions to redundant functional units on the processor.

• Each functional unit is not a separate CPU core but an execution resource

within a single CPU such as an arithmetic logic unit, a bit shifter, or a

multiplier.
Super Scalar Processors
cont…
• It therefore allows for more throughput (the number of instructions
that can be executed in a unit of time) than would otherwise be

possible at a given clock rate.


Super Scalar Processors
cont…
IF = Instruction Fetch

ID = Instruction Decode

EX = Execute

MEM = Memory access

WB = Register write back


Super Scalar Processors
cont…
• The superscalar technique is traditionally associated with several
characteristics:

1. Instructions are issued from a sequential instruction stream

2. The CPU dynamically checks for data dependencies between


instructions at run time (versus software checking at compile time)

3. The CPU can execute multiple instructions per clock cycle


Intel Hyper
Threading
• Intel® Hyper-Threading Technology (Intel® HT Technology) uses processor
resources more efficiently, enabling multiple threads to run on each core.

• As a performance feature, it also increases processor throughput,


improving overall performance on threaded software.

• Intel® HT Technology is available on the latest Intel® Core™ vPro™


processors, the Intel® Core™ processor family, the Intel® Core™ M
processor family, and the Intel® Xeon® processor family.
Intel Hyper Threading
cont…
• The main function of hyper-threading is to increase the number
of independent instructions in the pipeline; it takes advantage of
superscalar architecture, in which multiple instructions operate
on separate data in parallel.

You might also like