SlideShare uma empresa Scribd logo
1 de 50
Multiprocessor/Multicore Systems Scheduling, Synchronization
Multiprocessors ,[object Object]
Multiprocessor/Multicore Hardware (ex.1) ,[object Object]
Multiprocessor/Multicore  Hardware (ex.2)  UMA (uniform memory access)  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiprocessor/Multicore Hardware (ex.3)  NUMA (non-uniform memory access)  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Cache-coherence
Cache coherence (cont)  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
On multicores Reason for multicores : physical limitations can cause significant  heat dissipation  and  data synchronization  problems  In addition to operating system (OS) support, adjustments to existing software are required to maximize utilization of the computing resources provided by multi-core processors. Virtual machine approach again in focus . Intel Core 2 dual core processor, with CPU-local Level 1 caches+ shared, on-die Level 2 cache.
On multicores (cont) ,[object Object]
OS Design issues (1): Who executes the OS/scheduler(s)? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Master-Slave multiprocessor OS Bus
Non-symmetric Peer Multiprocessor OS  ,[object Object],Bus
Symmetric Peer Multiprocessor OS  ,[object Object],[object Object],Bus
Scheduling in Multiprocessors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Design issues 2:  Assignment of Processes to Processors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiprocessor Scheduling: per partition RQ ,[object Object],[object Object]
Multiprocessor Scheduling: Load sharing / Global ready queue ,[object Object],[object Object]
Multiprocessor Scheduling  Load Sharing: a problem ,[object Object],[object Object],[object Object]
Design issues 3: Multiprogramming on processors? ,[object Object],[object Object],[object Object],[object Object]
Gang Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Gang Scheduling: another option
Multiprocessor Thread Scheduling  Dynamic Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Summary: Multiprocessor Thread Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiprocessor Scheduling and Synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Readers-Writers non-blocking synchronization (some slides are adapted from J. Anderson’s slides on same topic)
The Mutual Exclusion Problem Locking Synchronization ,[object Object],while  true  do Noncritical Section; Entry Section; Critical Section; Exit Section od ,[object Object],[object Object],[object Object],[object Object]
Non-blocking Synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Locking
Non-blocking Synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Readers/Writers Problem ,[object Object],[object Object],[object Object],[object Object]
Solution 1 Readers have “priority”… Reader:: P( mutex ); rc  :=  rc  + 1; if  rc  = 1 then P( w ) fi; V( mutex ); CS; P( mutex ); rc  :=  rc     1; if  rc  = 0 then V( w ) fi; V( mutex ) Writer:: P( w ); CS; V( w ) “ First” reader executes P(w).  “Last” one executes V(w).
Solution 2 Writers have “priority” … readers should not build long queue on r, so that writers can overtake  =>  mutex3 Reader:: P( mutex3 ); P( r ); P( mutex1 ); rc  :=  rc  + 1; if  rc  = 1 then P( w ) fi; V( mutex1 ); V( r ); V( mutex3 ); CS; P( mutex1 ); rc  :=  rc     1; if  rc  = 0 then V( w ) fi; V( mutex1 ) Writer:: P( mutex2 ); wc  :=  wc  + 1; if  wc  = 1 then P( r ) fi; V( mutex2 ); P( w ); CS; V( w ); P( mutex2 ); wc  :=  wc     1; if  wc  = 0 then V( r ) fi; V( mutex2 )
Properties ,[object Object],[object Object],[object Object]
Concurrent Reading and Writing [Lamport ‘77] ,[object Object],[object Object],[object Object],[object Object],[object Object]
Interesting Factoids ,[object Object],[object Object]
The Problem ,[object Object],[object Object],[object Object],[object Object]
Preliminaries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More Preliminaries We say:   r  reads  v [ k,l ] . Value is  consistent  if  k  =  l . write: k write: k + i write: l        read  v 3 read  v 2 read  v m -1 read  v 1 read  v m read  r: 
Theorem 1 If  v  is always written from right to left, then a read from left to right obtains a value v 1 [ k 1 , l 1 ]  v 2 [ k 2 , l 2 ]  …   v m [ k m , l m ] where  k 1      l 1      k 2      l 2     …     k m      l m . Example:   v  =  v 1 v 2 v 3  =  d 1 d 2 d 3 Read reads  v 1 [0,0]  v 2 [1,1]  v 3 [2,2] . read :  read  v 1 read  d 1  read  v 2 read  d 2  read  v 3 read  d 3 write:1    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1 write:0    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1 write:2    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1
Another Example read : write:0    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2 write:1    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2  read  v 1 r d 1  r d 2  read  v 2 r d 4  r d 3 v  =  v 1   v 2 d 1 d 2 d 3 d 4 Read reads  v 1 [0,1]  v 2 [1,2] . write:2    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2
Theorem 2 Assume that  i      j  implies that  v [ i ]     v [ j ] , where  v  =  d 1  …  d m . (a) If  v  is always written from right to left, then a read from left to right obtains a value  v [ k , l ]      v [ l ] . (b) If  v  is always written from left to right, then a read from right to left obtains a value  v [ k , l ]      v [ k ] .
Example of (a) v   =  d 1 d 2 d 3 Read obtains  v [0,2]  = 390 < 400 =  v [2] . read :  read  d 1  read  d 2  read  d 3 write:1(399)    w d 3 w d 2 w d 1 9 9 3 write:0(398)    w d 3 w d 2 w d 1 8 9 3 write:2(400)    w d 3 w d 2 w d 1 0 0 4
Example of (b) v   =  d 1 d 2 d 3 Read obtains  v [0,2]  = 498 > 398 =  v [0] . read :  read  d 3  read  d 2  read  d 1 write:1(399)    w d 1 w d 2 w d 3 3 9 9 write:0(398)    w d 1 w d 2 w d 3 3 9 8 write:2(400)    w d 1 w d 2 w d 3 4 0 0
Readers/Writers Solution :> means assign larger value.  V1 means “left to right”.  V2 means “right to left”. Writer::  V1 :> V1; write D;  V2 := V1 Reader::  repeat temp := V2 read D  until V1 = temp
Proof Obligation ,[object Object],[object Object]
Proof By Theorem 2, V2 [ k 1 , l 1 ]     V2 [ l 1 ]   and  V1 [ k 3 ]     V1 [ k 3 , l 3 ] .  (1) Applying Theorem 1 to V2 D V1, k 1      l 1      k 2      l 2      k 3      l 3  .  (2) By the writer program, l 1      k 3     V2 [ l 1 ]     V1 [ k 3 ] .  (3) (1), (2), and (3) imply V2 [ k 1 , l 1 ]     V2 [ l 1 ]     V1 [ k 3 ]     V1 [ k 3 , l 3 ] . Hence,  V2 [ k 1 , l 1 ]  =   V1 [ k 3 , l 3 ]    V2 [ l 1 ]  =   V1 [ k 3 ]    l 1  =  k 3   , by the writer’s program.    k 2  =  l 2   by (2).
Supplemental Reading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Useful Synchronization Primitives Usually  Necessary  in Nonblocking Algorithms CAS2 extends this CAS(var, old, new)    if var    old then return false fi;  var := new; return true   LL(var)    establish “link” to var; return var   SC(var, val)    if “link” to var still exists then break all current links of all processes; var := val; return true else return false fi  
Another Lock-free Example Shared Queue type  Qtype = record v: valtype; next:  pointer to Qtype end shared var  Tail:  pointer to Qtype; local var  old, new: pointer to Qtype procedure Enqueue (input: valtype) new := (input,  NIL); repeat  old := Tail until  CAS2(Tail, old->next, old, NIL, new, new)  Tail old Tail old new new retry loop
Using Locks in Real-time Systems The  Priority Inversion  Problem Uncontrolled use of locks in RT systems can result in unbounded blocking due to priority inversions . Time   Low Med High t t t 0 1 2 Shared Object Access Priority  Inversion Computation not involving object accesses Solution:  Limit priority inversions by  modifying task priorities . Time  Low Med High t 0 t 1 t 2
Dealing with Priority Inversions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

Parallel architecture-programming
Parallel architecture-programmingParallel architecture-programming
Parallel architecture-programming
Shaveta Banda
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
Haris456
 
Multiprocessor scheduling 2
Multiprocessor scheduling 2Multiprocessor scheduling 2
Multiprocessor scheduling 2
mrbourne
 
Multiprocessor scheduling 1
Multiprocessor scheduling 1Multiprocessor scheduling 1
Multiprocessor scheduling 1
mrbourne
 
Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)
Sri Prasanna
 

Mais procurados (20)

Parallel architecture-programming
Parallel architecture-programmingParallel architecture-programming
Parallel architecture-programming
 
Process coordination
Process coordinationProcess coordination
Process coordination
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Scope of parallelism
Scope of parallelismScope of parallelism
Scope of parallelism
 
Aca 2
Aca 2Aca 2
Aca 2
 
Cache coherence problem and its solutions
Cache coherence problem and its solutionsCache coherence problem and its solutions
Cache coherence problem and its solutions
 
Multiprocessor scheduling 2
Multiprocessor scheduling 2Multiprocessor scheduling 2
Multiprocessor scheduling 2
 
Multiprocessor scheduling 1
Multiprocessor scheduling 1Multiprocessor scheduling 1
Multiprocessor scheduling 1
 
Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)
 
The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
 
Parallel Processing (Part 2)
Parallel Processing (Part 2)Parallel Processing (Part 2)
Parallel Processing (Part 2)
 
Introduction to parallel_computing
Introduction to parallel_computingIntroduction to parallel_computing
Introduction to parallel_computing
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling Algorithms
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processor
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
 
Introduction To Parallel Computing
Introduction To Parallel ComputingIntroduction To Parallel Computing
Introduction To Parallel Computing
 
Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)
 
Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed Systems
 

Destaque

Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time SystemsSara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
knowdiff
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
Employee
 
RPL : Incremental model
RPL : Incremental modelRPL : Incremental model
RPL : Incremental model
amalianuryamin
 

Destaque (20)

Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time SystemsSara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
 
Agile Vs Traditional Models
Agile Vs Traditional ModelsAgile Vs Traditional Models
Agile Vs Traditional Models
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
Agile modeling
Agile modelingAgile modeling
Agile modeling
 
Agile Architecture and Modeling - Where are we Today
Agile Architecture and Modeling - Where are we TodayAgile Architecture and Modeling - Where are we Today
Agile Architecture and Modeling - Where are we Today
 
Design for security in operating system
Design for security in operating systemDesign for security in operating system
Design for security in operating system
 
CA presentation of multicore processor
CA presentation of multicore processorCA presentation of multicore processor
CA presentation of multicore processor
 
78 identify input and output devices
78 identify input and output devices78 identify input and output devices
78 identify input and output devices
 
Coherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architectureCoherence and consistency models in multiprocessor architecture
Coherence and consistency models in multiprocessor architecture
 
Agile Modeling
Agile ModelingAgile Modeling
Agile Modeling
 
Dma
DmaDma
Dma
 
Input Output Control System
Input Output Control SystemInput Output Control System
Input Output Control System
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
Spiral model
Spiral modelSpiral model
Spiral model
 
Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA Controller
 
V model Over View (Software Engineering)
V model Over View (Software Engineering) V model Over View (Software Engineering)
V model Over View (Software Engineering)
 
RPL : Incremental model
RPL : Incremental modelRPL : Incremental model
RPL : Incremental model
 
Multicore Processors
Multicore ProcessorsMulticore Processors
Multicore Processors
 
Interrupts
InterruptsInterrupts
Interrupts
 
Comparison of different Agile Iterative process approaches
Comparison of different Agile Iterative process approachesComparison of different Agile Iterative process approaches
Comparison of different Agile Iterative process approaches
 

Semelhante a 10 Multicore 07

Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
mona_hakmy
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
tech2click
 
what every web and app developer should know about multithreading
what every web and app developer should know about multithreadingwhat every web and app developer should know about multithreading
what every web and app developer should know about multithreading
Ilya Haykinson
 

Semelhante a 10 Multicore 07 (20)

CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Processes, Threads and Scheduler
Processes, Threads and SchedulerProcesses, Threads and Scheduler
Processes, Threads and Scheduler
 
Threading.pptx
Threading.pptxThreading.pptx
Threading.pptx
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
what every web and app developer should know about multithreading
what every web and app developer should know about multithreadingwhat every web and app developer should know about multithreading
what every web and app developer should know about multithreading
 
parallel Questions &amp; answers
parallel Questions &amp; answersparallel Questions &amp; answers
parallel Questions &amp; answers
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]
 
Chapter04 new
Chapter04 newChapter04 new
Chapter04 new
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
CH04.pdf
CH04.pdfCH04.pdf
CH04.pdf
 
Multimaster
MultimasterMultimaster
Multimaster
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emption
 
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...
 
Bglrsession4
Bglrsession4Bglrsession4
Bglrsession4
 
Chapter 3 chapter reading task
Chapter 3 chapter reading taskChapter 3 chapter reading task
Chapter 3 chapter reading task
 

Último

unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
lizamodels9
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
amitlee9823
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Matteo Carbone
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Anamikakaur10
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
dlhescort
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
dlhescort
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
lizamodels9
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Sheetaleventcompany
 

Último (20)

unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
 

10 Multicore 07

  • 2.
  • 3.
  • 4.
  • 5.
  • 7.
  • 8. On multicores Reason for multicores : physical limitations can cause significant heat dissipation and data synchronization problems In addition to operating system (OS) support, adjustments to existing software are required to maximize utilization of the computing resources provided by multi-core processors. Virtual machine approach again in focus . Intel Core 2 dual core processor, with CPU-local Level 1 caches+ shared, on-die Level 2 cache.
  • 9.
  • 10.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 22.
  • 23.
  • 24.
  • 25. Readers-Writers non-blocking synchronization (some slides are adapted from J. Anderson’s slides on same topic)
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Solution 1 Readers have “priority”… Reader:: P( mutex ); rc := rc + 1; if rc = 1 then P( w ) fi; V( mutex ); CS; P( mutex ); rc := rc  1; if rc = 0 then V( w ) fi; V( mutex ) Writer:: P( w ); CS; V( w ) “ First” reader executes P(w). “Last” one executes V(w).
  • 31. Solution 2 Writers have “priority” … readers should not build long queue on r, so that writers can overtake => mutex3 Reader:: P( mutex3 ); P( r ); P( mutex1 ); rc := rc + 1; if rc = 1 then P( w ) fi; V( mutex1 ); V( r ); V( mutex3 ); CS; P( mutex1 ); rc := rc  1; if rc = 0 then V( w ) fi; V( mutex1 ) Writer:: P( mutex2 ); wc := wc + 1; if wc = 1 then P( r ) fi; V( mutex2 ); P( w ); CS; V( w ); P( mutex2 ); wc := wc  1; if wc = 0 then V( r ) fi; V( mutex2 )
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. More Preliminaries We say: r reads v [ k,l ] . Value is consistent if k = l . write: k write: k + i write: l        read v 3 read v 2 read v m -1 read v 1 read v m read r: 
  • 38. Theorem 1 If v is always written from right to left, then a read from left to right obtains a value v 1 [ k 1 , l 1 ] v 2 [ k 2 , l 2 ] … v m [ k m , l m ] where k 1  l 1  k 2  l 2  …  k m  l m . Example: v = v 1 v 2 v 3 = d 1 d 2 d 3 Read reads v 1 [0,0] v 2 [1,1] v 3 [2,2] . read :  read v 1 read d 1  read v 2 read d 2  read v 3 read d 3 write:1    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1 write:0    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1 write:2    w v 3 w v 2 w v 1 w d 3 w d 2 w d 1
  • 39. Another Example read : write:0    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2 write:1    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2  read v 1 r d 1  r d 2  read v 2 r d 4  r d 3 v = v 1 v 2 d 1 d 2 d 3 d 4 Read reads v 1 [0,1] v 2 [1,2] . write:2    w v 2 w v 1 w d 3 w d 4 w d 1  w d 2
  • 40. Theorem 2 Assume that i  j implies that v [ i ]  v [ j ] , where v = d 1 … d m . (a) If v is always written from right to left, then a read from left to right obtains a value v [ k , l ]  v [ l ] . (b) If v is always written from left to right, then a read from right to left obtains a value v [ k , l ]  v [ k ] .
  • 41. Example of (a) v = d 1 d 2 d 3 Read obtains v [0,2] = 390 < 400 = v [2] . read :  read d 1  read d 2  read d 3 write:1(399)    w d 3 w d 2 w d 1 9 9 3 write:0(398)    w d 3 w d 2 w d 1 8 9 3 write:2(400)    w d 3 w d 2 w d 1 0 0 4
  • 42. Example of (b) v = d 1 d 2 d 3 Read obtains v [0,2] = 498 > 398 = v [0] . read :  read d 3  read d 2  read d 1 write:1(399)    w d 1 w d 2 w d 3 3 9 9 write:0(398)    w d 1 w d 2 w d 3 3 9 8 write:2(400)    w d 1 w d 2 w d 3 4 0 0
  • 43. Readers/Writers Solution :> means assign larger value.  V1 means “left to right”.  V2 means “right to left”. Writer::  V1 :> V1; write D;  V2 := V1 Reader::  repeat temp := V2 read D  until V1 = temp
  • 44.
  • 45. Proof By Theorem 2, V2 [ k 1 , l 1 ]  V2 [ l 1 ] and V1 [ k 3 ]  V1 [ k 3 , l 3 ] . (1) Applying Theorem 1 to V2 D V1, k 1  l 1  k 2  l 2  k 3  l 3 . (2) By the writer program, l 1  k 3  V2 [ l 1 ]  V1 [ k 3 ] . (3) (1), (2), and (3) imply V2 [ k 1 , l 1 ]  V2 [ l 1 ]  V1 [ k 3 ]  V1 [ k 3 , l 3 ] . Hence, V2 [ k 1 , l 1 ] = V1 [ k 3 , l 3 ]  V2 [ l 1 ] = V1 [ k 3 ]  l 1 = k 3 , by the writer’s program.  k 2 = l 2 by (2).
  • 46.
  • 47. Useful Synchronization Primitives Usually Necessary in Nonblocking Algorithms CAS2 extends this CAS(var, old, new)  if var  old then return false fi; var := new; return true  LL(var)  establish “link” to var; return var  SC(var, val)  if “link” to var still exists then break all current links of all processes; var := val; return true else return false fi 
  • 48. Another Lock-free Example Shared Queue type Qtype = record v: valtype; next: pointer to Qtype end shared var Tail: pointer to Qtype; local var old, new: pointer to Qtype procedure Enqueue (input: valtype) new := (input, NIL); repeat old := Tail until CAS2(Tail, old->next, old, NIL, new, new) Tail old Tail old new new retry loop
  • 49. Using Locks in Real-time Systems The Priority Inversion Problem Uncontrolled use of locks in RT systems can result in unbounded blocking due to priority inversions . Time Low Med High t t t 0 1 2 Shared Object Access Priority Inversion Computation not involving object accesses Solution: Limit priority inversions by modifying task priorities . Time Low Med High t 0 t 1 t 2
  • 50.