SlideShare a Scribd company logo
1 of 9
Memory and Cache Coherence in
Multiprocessor System
Prepared by
Dr.S.Raja Ratna
1
2
Memory in Multiprocessor System
• A system with multiple CPUs “sharing” the same main memory is
called multiprocessor.
• In a multiprocessor system all processes on the various CPUs share
a unique logical address space, which is mapped on a physical
memory that can be distributed among the processors.
• Each process can read and write a data item simply using load and
store operations, and process communication is through shared
memory.
• It is the hardware that makes all CPUs access and use the same
main memory
Memory in Multiprocessor System
• Since all CPUs share the address space, only a single instance of
the operating system is required.
• When a process terminates or goes into a wait state for whichever
reason, the O.S. can look in the process table (more precisely, in
the ready processes queue) for another process to be dispatched
to the idle CPU.
• In systems with no shared memory, each CPU must have its own
copy of the operating system, and processes can only
communicate through message passing.
3
Memory in Multiprocessor System
• The basic issue in shared memory multiprocessor systems is
memory itself, since the larger the number of processors involved,
the more difficult to work on memory efficiently.
• All modern OS (Windows, Solaris, Linux, MacOS) support symmetric
multiprocessing, (SMP), with a scheduler running on every processor
(a simplified description, of course).
• “Ready to run” processes can be inserted into a single queue, that
can be accessed by every scheduler, alternatively there can be a
“ready to run” queue for each processor.
4
Memory in Multiprocessor System
• A distinct feature in multiprocessor systems is load balancing.
• It is useless having many CPUs in a system, if processes are not
distributed evenly among the cores.
• With a single “ready-to-run” queue, load balancing is usually
automatic: if a processor is idle, its scheduler will pick a process from
the shared queue and will start it on that processor.
5
6
Cache Coherency in MultiProcessor System
• In a multiprocessor system, data inconsistency may occur among
adjacent levels or within the same level of the memory hierarchy.
• In a shared memory multiprocessor with a separate cache memory
for each processor, it is possible to have many copies of any one
instruction operand: one copy in the main memory and one in each
cache memory.
• When one copy of an operand is changed, the other copies of the
operand must be changed also.
• Example : Cache and the main memory may have inconsistent
copies of the same object.
Cache Coherency in MultiProcessor System
• As multiple processors operate in parallel, and independently multiple
caches may possess different copies of the same memory block, this
creates a cache coherence problem.
• Cache coherence is the discipline that ensures that changes in the
values of shared operands are propagated throughout the system in a
timely fashion.
7
Cache Coherency in MultiProcessor System
1. Every write operation appears to occur instantaneously.
2. All processors see exactly the same sequence of changes of values
for each separate operand.
3. Different processors may see an operation and assume different
sequences of values; this is known as non-coherent behavior.
Coherency mechanisms : There are three types of coherence :
1. Directory-based
2. Snooping
3. Snarfing
8
Cache Coherency in MultiProcessor System
• There are various Cache Coherence Protocols in multiprocessor system.
• These are :-
1. MSI protocol (Modified, Shared, Invalid)
2. MOSI protocol (Modified, Owned, Shared, Invalid)
3. MESI protocol (Modified, Exclusive, Shared, Invalid)
4. MOESI protocol (Modified, Owned, Exclusive, Shared, Invalid)
9

More Related Content

Similar to Memory and Cache Coherence in Multiprocessor System.pdf

Introduction to multi core
Introduction to multi coreIntroduction to multi core
Introduction to multi core
mukul bhardwaj
 
M7_L3_PPT.computer organization and archit
M7_L3_PPT.computer organization and architM7_L3_PPT.computer organization and archit
M7_L3_PPT.computer organization and archit
Sindhu Mani
 
Module2 MultiThreads.ppt
Module2 MultiThreads.pptModule2 MultiThreads.ppt
Module2 MultiThreads.ppt
shreesha16
 

Similar to Memory and Cache Coherence in Multiprocessor System.pdf (20)

Introduction to multi core
Introduction to multi coreIntroduction to multi core
Introduction to multi core
 
Classification of Parallel Computers.pptx
Classification of Parallel Computers.pptxClassification of Parallel Computers.pptx
Classification of Parallel Computers.pptx
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processor
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Operating System Lecture 4
Operating System Lecture 4Operating System Lecture 4
Operating System Lecture 4
 
G.Sumithra,II-M.sc(computer science),Bon secours college for women,thanjavur.
G.Sumithra,II-M.sc(computer science),Bon secours college for women,thanjavur.G.Sumithra,II-M.sc(computer science),Bon secours college for women,thanjavur.
G.Sumithra,II-M.sc(computer science),Bon secours college for women,thanjavur.
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
 
Introduction 1
Introduction 1Introduction 1
Introduction 1
 
G.Sumithra,II-M.sc(computer Science),Bon Secours college for women,Thanjavur.
G.Sumithra,II-M.sc(computer Science),Bon Secours college for women,Thanjavur.G.Sumithra,II-M.sc(computer Science),Bon Secours college for women,Thanjavur.
G.Sumithra,II-M.sc(computer Science),Bon Secours college for women,Thanjavur.
 
Multiprocessor Scheduling
Multiprocessor SchedulingMultiprocessor Scheduling
Multiprocessor Scheduling
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
 
M7_L3_PPT.computer organization and archit
M7_L3_PPT.computer organization and architM7_L3_PPT.computer organization and archit
M7_L3_PPT.computer organization and archit
 
Cache memory
Cache memoryCache memory
Cache memory
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Smp and asmp architecture.
Smp and asmp architecture.Smp and asmp architecture.
Smp and asmp architecture.
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
 
parallel-processing.ppt
parallel-processing.pptparallel-processing.ppt
parallel-processing.ppt
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Module2 MultiThreads.ppt
Module2 MultiThreads.pptModule2 MultiThreads.ppt
Module2 MultiThreads.ppt
 

More from rajaratna4 (8)

Multicore processor.pdf
Multicore processor.pdfMulticore processor.pdf
Multicore processor.pdf
 
Hardware Multithreading.pdf
Hardware Multithreading.pdfHardware Multithreading.pdf
Hardware Multithreading.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

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 

Recently uploaded (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 

Memory and Cache Coherence in Multiprocessor System.pdf

  • 1. Memory and Cache Coherence in Multiprocessor System Prepared by Dr.S.Raja Ratna 1
  • 2. 2 Memory in Multiprocessor System • A system with multiple CPUs “sharing” the same main memory is called multiprocessor. • In a multiprocessor system all processes on the various CPUs share a unique logical address space, which is mapped on a physical memory that can be distributed among the processors. • Each process can read and write a data item simply using load and store operations, and process communication is through shared memory. • It is the hardware that makes all CPUs access and use the same main memory
  • 3. Memory in Multiprocessor System • Since all CPUs share the address space, only a single instance of the operating system is required. • When a process terminates or goes into a wait state for whichever reason, the O.S. can look in the process table (more precisely, in the ready processes queue) for another process to be dispatched to the idle CPU. • In systems with no shared memory, each CPU must have its own copy of the operating system, and processes can only communicate through message passing. 3
  • 4. Memory in Multiprocessor System • The basic issue in shared memory multiprocessor systems is memory itself, since the larger the number of processors involved, the more difficult to work on memory efficiently. • All modern OS (Windows, Solaris, Linux, MacOS) support symmetric multiprocessing, (SMP), with a scheduler running on every processor (a simplified description, of course). • “Ready to run” processes can be inserted into a single queue, that can be accessed by every scheduler, alternatively there can be a “ready to run” queue for each processor. 4
  • 5. Memory in Multiprocessor System • A distinct feature in multiprocessor systems is load balancing. • It is useless having many CPUs in a system, if processes are not distributed evenly among the cores. • With a single “ready-to-run” queue, load balancing is usually automatic: if a processor is idle, its scheduler will pick a process from the shared queue and will start it on that processor. 5
  • 6. 6 Cache Coherency in MultiProcessor System • In a multiprocessor system, data inconsistency may occur among adjacent levels or within the same level of the memory hierarchy. • In a shared memory multiprocessor with a separate cache memory for each processor, it is possible to have many copies of any one instruction operand: one copy in the main memory and one in each cache memory. • When one copy of an operand is changed, the other copies of the operand must be changed also. • Example : Cache and the main memory may have inconsistent copies of the same object.
  • 7. Cache Coherency in MultiProcessor System • As multiple processors operate in parallel, and independently multiple caches may possess different copies of the same memory block, this creates a cache coherence problem. • Cache coherence is the discipline that ensures that changes in the values of shared operands are propagated throughout the system in a timely fashion. 7
  • 8. Cache Coherency in MultiProcessor System 1. Every write operation appears to occur instantaneously. 2. All processors see exactly the same sequence of changes of values for each separate operand. 3. Different processors may see an operation and assume different sequences of values; this is known as non-coherent behavior. Coherency mechanisms : There are three types of coherence : 1. Directory-based 2. Snooping 3. Snarfing 8
  • 9. Cache Coherency in MultiProcessor System • There are various Cache Coherence Protocols in multiprocessor system. • These are :- 1. MSI protocol (Modified, Shared, Invalid) 2. MOSI protocol (Modified, Owned, Shared, Invalid) 3. MESI protocol (Modified, Exclusive, Shared, Invalid) 4. MOESI protocol (Modified, Owned, Exclusive, Shared, Invalid) 9