SlideShare a Scribd company logo
1 of 9
Hardware Multithreading
Prepared by
Dr. S. Raja Ratna
1
2
Hardware Multithreading
• Multithreading allows the execution of multiple parts of a
program at the same time. These parts are known as threads and
are lightweight processes available within the process.
• Multithreading leads to maximum utilization of the CPU by
multitasking.
• Multithreading is the ability of a central processing unit (or a
single core in a multi-core processor) to provide multiple threads of
execution concurrently, supported by the operating system.
Multithreading: Basics
• Thread
- Instruction stream with state (registers and memory)
- Register state is also called “thread context”.
• Threads could be part of the same program or from different
programs.
- Threads in the same program share the same address space.
• Traditionally, the processor keeps track of the context of a single
thread.
• Multitasking: When a new thread needs to be executed, old
thread’s context in hardware written back to memory and new thread’s
context loaded
3
Benefit and Cost of Hardware Multithreading
Benefits
- Latency tolerance.
- Better hardware utilization.
- Reduced context switch penalty.
Cost
- Requires multiple thread contexts to be implemented in
hardware (area, power, latency cost).
- Usually reduced single-thread performance.
- Resource sharing, contention.
- Switching penalty (can be reduced with additional hardware).
4
Types of Hardware Multithreading
1. Fine-grained Hardware Multithreading
- Cycle by cycle
2. Coarse-grained Hardware Multithreading
- Switch on event (e.g., cache miss)
- Switch on quantum/timeout
3. Simultaneous Hardware Multithreading
- Instructions from multiple threads executed concurrently in
the same cycle
5
6
Fine-grained Multithreading
• Switch to another thread every cycle such that no two instructions
from the thread are in the pipeline concurrently.
• Improves pipeline utilization by taking advantage of multiple threads.
• Tolerates the control and data dependency latencies by overlapping
the latency with useful work from other threads.
• No need for dependency checking between instructions (only one
instruction in pipeline from a single thread).
Fine-grained Multithreading
Advantages
- No need for branch prediction logic.
- Otherwise-bubble cycles used for executing useful instructions
from different threads.
- Improved system throughput, latency tolerance, utilization.
Disadvantages.
- Extra hardware complexity: multiple hardware contexts, thread
selection logic.
- Reduced single thread performance (one instruction fetched
every N cycles)
- Resource contention between threads in caches and memory
7
Coarse-grained Multithreading.
• When a thread is stalled due to some event, switch to a different
hardware context.
- Switch-on-event multithreading.
• Possible stall events.
- Cache misses.
- Synchronization events (e.g., load an empty location).
- FP operations.
• HEP, Tera combine fine-grained and coarse-grained.
- Thread waiting for memory becomes blocked.
8
Coarse-grained Multithreading
• Thread switch on
- Cache miss
- Network access
- Synchronization fault
• Coarse-grained requires a pipeline flush or a lot of hardware to save
pipeline state.
• Higher performance overhead with deep pipelines and large
windows.
9

More Related Content

Similar to Hardware Multithreading.pdf

Multithreaded processors ppt
Multithreaded processors pptMultithreaded processors ppt
Multithreaded processors pptSiddhartha Anand
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptxbleh23
 
18 parallel processing
18 parallel processing18 parallel processing
18 parallel processingdilip kumar
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture Haris456
 
Multicore processor.pdf
Multicore processor.pdfMulticore processor.pdf
Multicore processor.pdfrajaratna4
 
Multithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdfMultithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdfHarika Pudugosula
 
1 Multithreading basics.pptx
1 Multithreading basics.pptx1 Multithreading basics.pptx
1 Multithreading basics.pptxYojanaFegade
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Kasun Gajasinghe
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
 

Similar to Hardware Multithreading.pdf (20)

Multithreaded processors ppt
Multithreaded processors pptMultithreaded processors ppt
Multithreaded processors ppt
 
Threads
ThreadsThreads
Threads
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Threads
ThreadsThreads
Threads
 
Thread
ThreadThread
Thread
 
Thread
ThreadThread
Thread
 
parallel-processing.ppt
parallel-processing.pptparallel-processing.ppt
parallel-processing.ppt
 
18 parallel processing
18 parallel processing18 parallel processing
18 parallel processing
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
Thread
ThreadThread
Thread
 
4 threads
4 threads4 threads
4 threads
 
Multicore processor.pdf
Multicore processor.pdfMulticore processor.pdf
Multicore processor.pdf
 
Multithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdfMultithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdf
 
1 Multithreading basics.pptx
1 Multithreading basics.pptx1 Multithreading basics.pptx
1 Multithreading basics.pptx
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 

More from rajaratna4

Memory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdfMemory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdfrajaratna4
 
Flynn's classification.pdf
Flynn's classification.pdfFlynn's classification.pdf
Flynn's classification.pdfrajaratna4
 
Classes and Errors.pdf
Classes and Errors.pdfClasses and Errors.pdf
Classes and Errors.pdfrajaratna4
 
Example for Virtual and Pure Virtual function.pdf
Example for Virtual and Pure Virtual function.pdfExample for Virtual and Pure Virtual function.pdf
Example for Virtual and Pure Virtual function.pdfrajaratna4
 
Example for Abstract Class and Interface.pdf
Example for Abstract Class and Interface.pdfExample for Abstract Class and Interface.pdf
Example for Abstract Class and Interface.pdfrajaratna4
 
Abstract Class and Interface.pdf
Abstract Class and Interface.pdfAbstract Class and Interface.pdf
Abstract Class and Interface.pdfrajaratna4
 

More from rajaratna4 (7)

Memory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdfMemory and Cache Coherence in Multiprocessor System.pdf
Memory and Cache Coherence in Multiprocessor System.pdf
 
Flynn's classification.pdf
Flynn's classification.pdfFlynn's classification.pdf
Flynn's classification.pdf
 
Classes and Errors.pdf
Classes and Errors.pdfClasses and Errors.pdf
Classes and Errors.pdf
 
STLStack.pdf
STLStack.pdfSTLStack.pdf
STLStack.pdf
 
Example for Virtual and Pure Virtual function.pdf
Example for Virtual and Pure Virtual function.pdfExample for Virtual and Pure Virtual function.pdf
Example for Virtual and Pure Virtual function.pdf
 
Example for Abstract Class and Interface.pdf
Example for Abstract Class and Interface.pdfExample for Abstract Class and Interface.pdf
Example for Abstract Class and Interface.pdf
 
Abstract Class and Interface.pdf
Abstract Class and Interface.pdfAbstract Class and Interface.pdf
Abstract Class and Interface.pdf
 

Recently uploaded

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 

Hardware Multithreading.pdf

  • 2. 2 Hardware Multithreading • Multithreading allows the execution of multiple parts of a program at the same time. These parts are known as threads and are lightweight processes available within the process. • Multithreading leads to maximum utilization of the CPU by multitasking. • Multithreading is the ability of a central processing unit (or a single core in a multi-core processor) to provide multiple threads of execution concurrently, supported by the operating system.
  • 3. Multithreading: Basics • Thread - Instruction stream with state (registers and memory) - Register state is also called “thread context”. • Threads could be part of the same program or from different programs. - Threads in the same program share the same address space. • Traditionally, the processor keeps track of the context of a single thread. • Multitasking: When a new thread needs to be executed, old thread’s context in hardware written back to memory and new thread’s context loaded 3
  • 4. Benefit and Cost of Hardware Multithreading Benefits - Latency tolerance. - Better hardware utilization. - Reduced context switch penalty. Cost - Requires multiple thread contexts to be implemented in hardware (area, power, latency cost). - Usually reduced single-thread performance. - Resource sharing, contention. - Switching penalty (can be reduced with additional hardware). 4
  • 5. Types of Hardware Multithreading 1. Fine-grained Hardware Multithreading - Cycle by cycle 2. Coarse-grained Hardware Multithreading - Switch on event (e.g., cache miss) - Switch on quantum/timeout 3. Simultaneous Hardware Multithreading - Instructions from multiple threads executed concurrently in the same cycle 5
  • 6. 6 Fine-grained Multithreading • Switch to another thread every cycle such that no two instructions from the thread are in the pipeline concurrently. • Improves pipeline utilization by taking advantage of multiple threads. • Tolerates the control and data dependency latencies by overlapping the latency with useful work from other threads. • No need for dependency checking between instructions (only one instruction in pipeline from a single thread).
  • 7. Fine-grained Multithreading Advantages - No need for branch prediction logic. - Otherwise-bubble cycles used for executing useful instructions from different threads. - Improved system throughput, latency tolerance, utilization. Disadvantages. - Extra hardware complexity: multiple hardware contexts, thread selection logic. - Reduced single thread performance (one instruction fetched every N cycles) - Resource contention between threads in caches and memory 7
  • 8. Coarse-grained Multithreading. • When a thread is stalled due to some event, switch to a different hardware context. - Switch-on-event multithreading. • Possible stall events. - Cache misses. - Synchronization events (e.g., load an empty location). - FP operations. • HEP, Tera combine fine-grained and coarse-grained. - Thread waiting for memory becomes blocked. 8
  • 9. Coarse-grained Multithreading • Thread switch on - Cache miss - Network access - Synchronization fault • Coarse-grained requires a pipeline flush or a lot of hardware to save pipeline state. • Higher performance overhead with deep pipelines and large windows. 9