SlideShare a Scribd company logo
Mutual Exclusion in
Distributed Memory Systems
CS4532 Concurrent Programming
Dilum Bandara
Dilum.Bandara@uom.lk
Some slides adapted from U Uthaiyashankar (WSO2) and Rajkumar Buyya’s
Exercise
 Come up with a solution to enforce following
synchronization between 2 threads x & y
 Thread x writes to a file f. Then only thread y should
read from f
 Now suppose x & y are 2 processes on 2
different nodes (assume a shared file system)
 Propose a suitable solution to achieve
synchronization
2
Mutual Exclusion Problems
 Centralized algorithms for mutual exclusion
 Semaphores, Monitors, Condition Variables
 Mutual exclusion in distributed memory systems
 No shared memory
 Usually, no centralized instance similar to OS kernel
that would coordinate access
 Based on asynchronous, usually failure-prone,
network infrastructure
 Need a solution for distributed mutual exclusion,
based solely on message passing
3
Mutual Exclusion Requirements
 Safeness property
 Liveness property
 Ordering
 A fairness issue
 Efficient
4
Source: http://pk.org/417/notes/10-mutex.html
Question from 2013 S7 Paper
 There are monkeys living on 2 very high rocks. The
northern monkeys live on the northern rock that provides
water but no food. Conversely, the southern monkeys
live on the southern rock that provides food but no water.
However, both the northern and southern monkeys have
to eat and to drink!
 There is a small rope between the 2 rocks. The rope can
carry up to MaxOnRope monkeys. Concurrent crossing
in both directions is not possible.
1. What type of a solution would you recommend for this
problem? Briefly explain. [3 marks]
2. Provide a pueudocode to solve the problem. [5 marks]
5
Mutual Exclusion Algorithms
6
Mutual Exclusion
algorithms
Centralized
Locks Semaphores Monitors
Distributed
Contention
Based
Voting schemes
Timestamp
priority based
Controlled
(Token based)
Central
server
Ring
Structure
Tree
Structure
Mutual Exclusion Algorithms (Cont.)
1. Centralized algorithm
2. Decentralized algorithm
3. Token-based algorithm
4. Distributed algorithm
7
1. Centralized Algorithm
 Central server that grants permission to enter
critical section
8
Source: http://lycog.com/distributed-systems/centralized-algorithm-mutual-exclusion-in-distributed-systems/
Central Server Algorithm
 Mutual exclusion requirements
 Safeness property – satisfied
 Liveness property – satisfied
 Ordering – not satisfied
 Due to network delay
 Other concerns
 2 messages per request + 1 message to release
 Resource can’t be accessed until at least for a round
trip time
 Delay between 1 process leaving critical section &
another entering
 Single point of failure 9
2. Decentralized Algorithm
10
2. Decentralized Algorithm (Cont.)
 Use many replicas of resources & many
coordinators
 To enter a critical section, a process sends a
request message to coordinators & awaits reply
 Need majority vote from coordinators
 If denied, back-off & retry later
 Can lead to low utilization, particularly under high
contention
 Avoids problem of single point of failure
11
3. Token-Based Algorithm
 Pass a token around
 Whoever having token has exclusive access to
shared resource
 Examples, token ring
12
Source: http://lycog.com/distributed-systems/token-ring-mutual-exclusion-in-distributed-systems/
Ring-Based Algorithm
 Mutual exclusion requirements
 Safeness property – satisfied
 Liveness property – satisfied
 Ordering – not satisfied
 Follow ring order, not order requested by processes
 Other concerns
 Token passing
 Worst case waiting time O(N)
 N – no of processes in the ring
 Delay between 1 process leaving critical section &
another entering is O(N)
13
4. Distributed Algorithm
 By Lamport in 1978, Improved by Ricart & Agrawala in 1981
14
Source: http://lycog.com/distributed-systems/distributed-algorithm-mutual-exclusion-distributed-systems/
Distributed Algorithm
 Mutual exclusion requirements
 Safeness property – satisfied
 Liveness property – satisfied
 Ordering – satisfied
 Events are in total order
 Other concerns
 High overhead
 Gaining entry requires 2(N-1) messages per request
 N – 1 to multicast request followed by N – 1 replies
 Resource can’t be accessed until at least for a round
trip time
 Delay between 1 process leaving critical section &
another entering is 1 message 15
Distributed Algorithm (Cont.)
 N points of failures
 Before granting access each process needs to reply
 If 1 process failed?
 Probability of failure p vs. Np
 N bottlenecks
 Each process need to respond to messages from all
other processes
16
Mutual Exclusion Algorithm
Comparison
 Comparison assumes that messages are passed
sequentially (sent 1 after another) over a network
17
Contention vs. Token Based
Contention
 Competition among
processes
 May need to retry
repeatedly
 No token
 Voting improves fault
tolerance
 What if no majority?
 More complicated to
implement
Token
 Avoid deadlocks
 Avoid starvation by
efficient organization of
processes
 Lost token?
 How to create a new one?
 How to create only 1
token?
18

More Related Content

Similar to Mutual Exclusion in Distributed Memory Systems

DTN
DTNDTN
Chapter 02
Chapter 02Chapter 02
Chapter 02
Geonyzl Alviola
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
Google
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
tech2click
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
mha4
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
mha4
 
Pbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithmPbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithm
ijp2p
 
Pbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithmPbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithm
ijp2p
 
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHMPBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
ijp2p
 
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHMPBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
ijp2p
 
The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
Peter Shirley-Quirk
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
Saeed Siddik
 
Lecture 9 - Process Synchronization.pptx
Lecture 9 - Process Synchronization.pptxLecture 9 - Process Synchronization.pptx
Lecture 9 - Process Synchronization.pptx
EhteshamulIslam1
 
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed SystemsComparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
IJERA Editor
 
Distributed clouds — micro clouds
Distributed clouds — micro cloudsDistributed clouds — micro clouds
Distributed clouds — micro clouds
Faculty of Technical Sciences, University of Novi Sad
 
Rtos
RtosRtos
D24019026
D24019026D24019026
D24019026
IJERA Editor
 
Cost-effective software reliability through autonomic tuning of system resources
Cost-effective software reliability through autonomic tuning of system resourcesCost-effective software reliability through autonomic tuning of system resources
Cost-effective software reliability through autonomic tuning of system resources
Vincenzo De Florio
 
Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membership
Augusto Ciuffoletti
 
Network Layer
Network LayerNetwork Layer
Network Layer
Rutwik Jadhav
 

Similar to Mutual Exclusion in Distributed Memory Systems (20)

DTN
DTNDTN
DTN
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
 
Pbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithmPbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithm
 
Pbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithmPbcbt an improvement of ntbcbt algorithm
Pbcbt an improvement of ntbcbt algorithm
 
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHMPBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
 
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHMPBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
PBCBT: AN IMPROVEMENT OF NTBCBT ALGORITHM
 
The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
 
Lecture 9 - Process Synchronization.pptx
Lecture 9 - Process Synchronization.pptxLecture 9 - Process Synchronization.pptx
Lecture 9 - Process Synchronization.pptx
 
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed SystemsComparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
 
Distributed clouds — micro clouds
Distributed clouds — micro cloudsDistributed clouds — micro clouds
Distributed clouds — micro clouds
 
Rtos
RtosRtos
Rtos
 
D24019026
D24019026D24019026
D24019026
 
Cost-effective software reliability through autonomic tuning of system resources
Cost-effective software reliability through autonomic tuning of system resourcesCost-effective software reliability through autonomic tuning of system resources
Cost-effective software reliability through autonomic tuning of system resources
 
Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membership
 
Network Layer
Network LayerNetwork Layer
Network Layer
 

More from Dilum Bandara

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
Dilum Bandara
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
Dilum Bandara
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
Dilum Bandara
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
Dilum Bandara
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
Dilum Bandara
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Dilum Bandara
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
Dilum Bandara
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
Dilum Bandara
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
Dilum Bandara
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
Dilum Bandara
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
Dilum Bandara
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
Dilum Bandara
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
Dilum Bandara
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
Dilum Bandara
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
Dilum Bandara
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
Dilum Bandara
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
Dilum Bandara
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
Dilum Bandara
 

More from Dilum Bandara (20)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 

Recently uploaded

一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 

Recently uploaded (20)

一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 

Mutual Exclusion in Distributed Memory Systems

  • 1. Mutual Exclusion in Distributed Memory Systems CS4532 Concurrent Programming Dilum Bandara Dilum.Bandara@uom.lk Some slides adapted from U Uthaiyashankar (WSO2) and Rajkumar Buyya’s
  • 2. Exercise  Come up with a solution to enforce following synchronization between 2 threads x & y  Thread x writes to a file f. Then only thread y should read from f  Now suppose x & y are 2 processes on 2 different nodes (assume a shared file system)  Propose a suitable solution to achieve synchronization 2
  • 3. Mutual Exclusion Problems  Centralized algorithms for mutual exclusion  Semaphores, Monitors, Condition Variables  Mutual exclusion in distributed memory systems  No shared memory  Usually, no centralized instance similar to OS kernel that would coordinate access  Based on asynchronous, usually failure-prone, network infrastructure  Need a solution for distributed mutual exclusion, based solely on message passing 3
  • 4. Mutual Exclusion Requirements  Safeness property  Liveness property  Ordering  A fairness issue  Efficient 4 Source: http://pk.org/417/notes/10-mutex.html
  • 5. Question from 2013 S7 Paper  There are monkeys living on 2 very high rocks. The northern monkeys live on the northern rock that provides water but no food. Conversely, the southern monkeys live on the southern rock that provides food but no water. However, both the northern and southern monkeys have to eat and to drink!  There is a small rope between the 2 rocks. The rope can carry up to MaxOnRope monkeys. Concurrent crossing in both directions is not possible. 1. What type of a solution would you recommend for this problem? Briefly explain. [3 marks] 2. Provide a pueudocode to solve the problem. [5 marks] 5
  • 6. Mutual Exclusion Algorithms 6 Mutual Exclusion algorithms Centralized Locks Semaphores Monitors Distributed Contention Based Voting schemes Timestamp priority based Controlled (Token based) Central server Ring Structure Tree Structure
  • 7. Mutual Exclusion Algorithms (Cont.) 1. Centralized algorithm 2. Decentralized algorithm 3. Token-based algorithm 4. Distributed algorithm 7
  • 8. 1. Centralized Algorithm  Central server that grants permission to enter critical section 8 Source: http://lycog.com/distributed-systems/centralized-algorithm-mutual-exclusion-in-distributed-systems/
  • 9. Central Server Algorithm  Mutual exclusion requirements  Safeness property – satisfied  Liveness property – satisfied  Ordering – not satisfied  Due to network delay  Other concerns  2 messages per request + 1 message to release  Resource can’t be accessed until at least for a round trip time  Delay between 1 process leaving critical section & another entering  Single point of failure 9
  • 11. 2. Decentralized Algorithm (Cont.)  Use many replicas of resources & many coordinators  To enter a critical section, a process sends a request message to coordinators & awaits reply  Need majority vote from coordinators  If denied, back-off & retry later  Can lead to low utilization, particularly under high contention  Avoids problem of single point of failure 11
  • 12. 3. Token-Based Algorithm  Pass a token around  Whoever having token has exclusive access to shared resource  Examples, token ring 12 Source: http://lycog.com/distributed-systems/token-ring-mutual-exclusion-in-distributed-systems/
  • 13. Ring-Based Algorithm  Mutual exclusion requirements  Safeness property – satisfied  Liveness property – satisfied  Ordering – not satisfied  Follow ring order, not order requested by processes  Other concerns  Token passing  Worst case waiting time O(N)  N – no of processes in the ring  Delay between 1 process leaving critical section & another entering is O(N) 13
  • 14. 4. Distributed Algorithm  By Lamport in 1978, Improved by Ricart & Agrawala in 1981 14 Source: http://lycog.com/distributed-systems/distributed-algorithm-mutual-exclusion-distributed-systems/
  • 15. Distributed Algorithm  Mutual exclusion requirements  Safeness property – satisfied  Liveness property – satisfied  Ordering – satisfied  Events are in total order  Other concerns  High overhead  Gaining entry requires 2(N-1) messages per request  N – 1 to multicast request followed by N – 1 replies  Resource can’t be accessed until at least for a round trip time  Delay between 1 process leaving critical section & another entering is 1 message 15
  • 16. Distributed Algorithm (Cont.)  N points of failures  Before granting access each process needs to reply  If 1 process failed?  Probability of failure p vs. Np  N bottlenecks  Each process need to respond to messages from all other processes 16
  • 17. Mutual Exclusion Algorithm Comparison  Comparison assumes that messages are passed sequentially (sent 1 after another) over a network 17
  • 18. Contention vs. Token Based Contention  Competition among processes  May need to retry repeatedly  No token  Voting improves fault tolerance  What if no majority?  More complicated to implement Token  Avoid deadlocks  Avoid starvation by efficient organization of processes  Lost token?  How to create a new one?  How to create only 1 token? 18

Editor's Notes

  1. Use send() & receive() discussed in MPI class
  2. m – no of coordinators k – no of attempts Inf in token ring – as token may get passed without any one wanting it
  3. If no majority – one of the processes can be asked to change its vote