SlideShare ist ein Scribd-Unternehmen logo
1 von 81
Downloaden Sie, um offline zu lesen
Distributed Operating
Systems
Sandeep Kumar Poonia
Head of Dept. CS/IT
B.E., M.Tech., UGC-NET
LM-IAENG, LM-IACSIT,LM-CSTA, LM-AIRCC, LM-SCIEI, AM-UACEE
1 MCS 5.1 2
•Mutual Exclusion
•Election Algorithms
•AtomicTransactions in
Distributed Systems
Process Synchronization
Techniques to coordinate execution among
processes
◦ One process may have to wait for another
◦ Shared resource (e.g. critical section) may
require exclusive access
1 MCS 5.1 3
What is mutual exclusion?
 When a process is accessing a shared
variable, the process is said to be in a CS
(critical section).
 No two process can be in the same CS at
the same time. This is called mutual
exclusion.
1 MCS 5.1 4
Distributed Mutual Exclusion
 Assume there is agreement on how a
resource is identified
◦ Pass identifier with requests
 Create an algorithm to allow a process to
obtain exclusive access to a resource
1 MCS 5.1 5
Distributed Mutual Exclusion
 Centralized Algorithm
 Token Ring Algorithm
 Distributed Algorithm
 Decentralized Algorithm
1 MCS 5.1 6
Centralized algorithm
 Mimic single processor system
 One process elected as coordinator
P
C
request(R)
grant(R)
1. Request resource
2. Wait for response
3. Receive grant
4. access resource
5. Release resource
release(R)
1 MCS 5.1 7
Centralized algorithm
If another process claimed resource:
◦ Coordinator does not reply until release
◦ Maintain queue
 Service requests in FIFO order
P0
C
request(R)
grant(R)
release(R) P1
P2
request(R)
Queue
P1
request(R)
P2
grant(R)
1 MCS 5.1 8
ADVANTAGES:
1 MCS 5.1 9
Mutual exclusion can be achieved.
The coordinator lets only one process at a
time into each CS.
It is fair.
Requests are granted in the order in which
they are received.
No process waits forever.
Easy to implement.
It can be used for general resource allocation
rather than just managing mutual exclusion.
DISADVANTAGES
 The coordinator is a single point of failure,
so if it crashes, the entire system may go
down.
 If process normally block after making a
request, they cannot distinguish a dead
coordinator from
"access denied" since in both cases
coordinator doesn't reply.
 In a large system, a single coordinator has
to take care of all process.
1 MCS 5.1 10
Token Ring algorithm
Assume known group of processes
◦ Some ordering can be imposed on group
◦ Construct logical ring in software
◦ Process communicates with neighbor
P0
P1
P2
P3
P4
P5
1 MCS 5.1 11
Token Ring algorithm
 Initialization
◦ Process 0 gets token for resource R
 Token circulates around ring
 When process acquires token
◦ Checks to see if it needs to enter critical
section
◦ If no, send token to neighbor
◦ If yes, access resource
 Hold token until done
P0
P1
P2
P3
P4
P5
token(R)
1 MCS 5.1 12
Token Ring algorithm
 Only one process at a time has token
◦ Mutual exclusion guaranteed
 Order well-defined
◦ Starvation cannot occur
 If token is lost (e.g. process died)
◦ It will have to be regenerated
 Does not guarantee FIFO order
◦ sometimes this is undesirable
1 MCS 5.1 13
ADVANTAGES
 The correctness of this algorithm is
evident. Only one process has the token
at any instant, so only one process can be
in a CS.
 Since the token circulates among
processes in a well-defined order,
starvation cannot occur.
1 MCS 5.1 14
DISADVANTAGES
 Once a process decides it wants to enter a CS, at worst it will
have to wait for every other process to enter
and leave one critical region.
 If the token is ever lost, it must be regenerated. In fact,
detecting that it is lost is difficult, since the amount of time
between successive appearances of the token on the network
is not a constant. The fact that the token has not been spotted
for an hour does not mean that it has been lost; some process
may still be using it.
1 MCS 5.1 15
DISADVANTAGES…………
 The algorithm also runs into trouble if a
process crashes, but recovery is easier than in
the other cases.
 If we require a process receiving the token to
acknowledge receipt, a dead process will be
detected when its neighbor tries to give it the
token and fails. At that point the dead process
can be removed from the group, and the token
holder can pass the token to the next member
down the line.
1 MCS 5.1 16
Ricart & Agrawala algorithm
 Distributed algorithm using reliable
multicast and logical clocks
 Process wants to enter critical section:
◦ Compose message containing:
 Identifier (machine ID, process ID)
 Name of resource
 Timestamp (totally-ordered Lamport)
◦ Send request to all processes in group
◦ Wait until everyone gives permission
◦ Enter critical section / use resource
1 MCS 5.1 17
Ricart & Agrawala algorithm
 When process receives request:
◦ If receiver not interested:
 Send OK to sender
◦ If receiver is in critical section
 Do not reply; add request to queue
◦ If receiver just sent a request as well:
 Compare timestamps: received & sent messages
 Earliest wins
 If receiver is loser, send OK
 If receiver is winner, do not reply, queue
 When done with critical section
◦ Send OK to all queued requests
1 MCS 5.1 18
Ricart & Agrawala algorithm
 N points of failure
 A lot of messaging traffic
 Demonstrates that a fully distributed
algorithm is possible
1 MCS 5.1 19
ADVANTAGES
 Mutual exclusion can be achieved without
deadlock or starvation.
 The number of messages required per
entry into CS is 2(n-1), where the total
number of process in the
system is n.
 All processes are involved in all decisions.
1 MCS 5.1 20
DISADVANTAGES
 Unfortunately, the single point of failure has been replaced by n
points of failure.
 If any process crashes, it will fail to respond to requests.
 This silence will be interpreted incorrectly as denial of
permission.
 Since the chance of one of the n process failing is n times the
single coordinator failing, we have devised an algorithm which is
n times worse than the centralized algorithm.
 Each process must maintain the group membership list itself,
including processes entering the group, leaving the group and
crashing.
 This algorithm is slower, more complicated, more expensive and
less robust than the origianl centralized one.
1 MCS 5.1 21
Lamport’s Mutual Exclusion
Each process maintains request queue
◦ Contains mutual exclusion requests
Requesting critical section:
◦ Process Pi sends request(i, Ti) to all nodes
◦ Places request on its own queue
◦ When a process Pj receives
a request, it returns a timestamped ack
Lamport time
1 MCS 5.1 22
Lamport’s Mutual Exclusion
Entering critical section (accessing resource):
◦ Pi received a message (ack or release) from every
other process with a timestamp larger thanTi
◦ Pi’s request has the earliest timestamp in its
queue
Difference from Ricart-Agrawala:
◦ Everyone responds … always - no hold-back
◦ Process decides to go based on whether its
request is the earliest in its queue
1 MCS 5.1 23
Lamport’s Mutual Exclusion
Releasing critical section:
◦ Remove request from its own queue
◦ Send a timestamped release message
◦ When a process receives a release message
 Removes request for that process from its queue
 This may cause its own entry have the earliest
timestamp in the queue, enabling it to access the critical
section
1 MCS 5.1 24
Characteristics of Decentralized
Algorithms
 No machine has complete information about the
system state
 Machines make decisions based only on local
information
 Failure of one machine does not ruin the algorithm
 Three is no implicit assumption that a global clock
exists
1 MCS 5.1 25
Decentralized Algorithm
 Based on the Distributed HashTable
(DHT) system structure previously
introduced
◦ Peer-to-peer
◦ Object names are hashed to find the
successor node that will store them
 Here, we assume that n replicas of each
object are stored
1 MCS 5.1 26
Placing the Replicas
 The resource is known by a unique name:
rname
◦ Replicas: rname-0, rname-I, …, rname-(n-1)
◦ rname-i is stored at succ(rname-i), where
names and site names are hashed as before
◦ If a process knows the name of the resource
it wishes to access, it also can generate the
hash keys that are used to locate all the
replicas
1 MCS 5.1 27
The Decentralized Algorithm
 Every replica has a coordinator that
controls access to it (the coordinator is
the node that stores it)
 For a process to use the resource it must
receive permission from m > n/2
coordinators
 This guarantees exclusive access as long
as a coordinator only grants access to
one process at a time
1 MCS 5.1 28
The Decentralized Algorithm
 The coordinator notifies the requester
when it has been denied access as well as
when it is granted
◦ Requester must “count the votes”, and decide
whether or not overall permission has been
granted or denied
 If a processor (requester) gets fewer than
m votes it will wait for a random time and
then ask again
1 MCS 5.1 29
Analysis
 If a resource is in high demand, multiple
requests will be generated
 It’s possible that processes will wait a long
time to get permission
 Deadlock?
 Resource usage drops
1 MCS 5.1 30
Analysis
 More robust than the central coordinator
approach. If one coordinator goes down
others are available.
◦ If a coordinator fails and resets then it will not
remember having granted access to one
requestor, and may then give access to another.
According to the authors, it is highly unlikely
that this will lead to a violation of mutual
exclusion.
1 MCS 5.1 31
1 MCS 5.1 32
Election Algorithms
 If we are using one process as a
coordinator for a shared resource …
 …how do we select that one process?
331 MCS 5.1
Solution – an Election
 All nodes currently involved get together
to choose a coordinator
 If the coordinator crashes or becomes
isolated, elect a new coordinator
 If a previously crashed or isolated node,
comes on line, a new election may have to
be held
341 MCS 5.1
Election Algorithms
 Wired systems
 Bully algorithm
 Ring algorithm
 Wireless systems
 Very large-scale systems
351 MCS 5.1
Bully Algorithm
• Assume
• All processes know about each other
• Processes numbered uniquely
• They do not know each other’s state
• Suppose P notices no coordinator
• Sends election message to all higher numbered
processes
• If none response, P takes over as coordinator
• If any responds, P yields
• …
361 MCS 5.1
Bully Algorithm (continued)
 …
 Suppose Q receives election message
 Replies OK to sender, saying it will take over
 Sends a new election message to higher numbered
processes
 Repeat until only one process left
standing
 Announces victory by sending message saying that
it is the coordinator
371 MCS 5.1
Bully Algorithm (continued)
381 MCS 5.1
Bully Algorithm (continued)
 …
 Suppose R comes back on line
 Sends a new election message to higher numbered
processes
 Repeat until only one process left standing
 Announces victory by sending message saying that it is
the coordinator (if not already the coordinator)
 Existing (lower numbered) coordinator
yields
 Hence the term “bully”
391 MCS 5.1
Alternative – Ring Algorithm
 All processes organized in ring
 Independent of process number
 Suppose P notices no coordinator
 Sends election message to successor with own
process number in body of message
 (If successor is down, skip to next process, etc.)
 Suppose Q receives an election message
 Adds own process number to list in message body
 …
401 MCS 5.1
Alternative – Ring Algorithm
 Suppose P receives an election message with
its own process number in body
 Changes message to coordinator message, preserving
body
 All processes recognize highest numbered process as
new coordinator
 If multiple messages circulate …
 …they will all contain same list of processes (eventually)
 If process comes back on-line
 Calls new election
411 MCS 5.1
Ring Algorithm (continued)
421 MCS 5.1
Wireless Environments
• Unreliable, and nodes may move
• Network topology constantly changing
• Algorithm:
1. Any node starts by sending out an ELECTION
message to neighbors
2. When a node receives an ELECTION message for
the first time, it forwards to neighbors, and
designates the sender as its parent
3. It then waits for responses from is neighbors
• Responses may carry resource information
4. When a node receives an ELECTION message for
the second time, it just OKs it
1 MCS 5.1 43
(a)
(c)
(b)
(d)
1 MCS 5.1 44
Elections in Wireless Environment
(e)The build-tree phase. (f) Reporting of best node
to source.
c c
1 MCS 5.1 45
Very Large Scale Networks
 Sometimes more than one node should
be selected
 Nodes organized as peers and super-peers
 Elections held within each peer group
 Super-peers coordinate among themselves
461 MCS 5.1
1 MCS 5.1 47
48
 OS Processes  DBMS Transactions
 A collection of actions that make consistent
transformation of system states while preserving
consistency
 Termination of transactions – commit vs abort
 Example:
T : x = x + y
R(x)
Read(x) W(x) C
Read(y) R(y)
Write(x)
Commit
1 MCS 5.1
1 MCS 5.1 49
Definition – Transaction
 A sequence of operations that perform a
single logical function
 Examples
 Withdrawing money from your account
 Making an airline reservation
 Making a credit-card purchase
 Registering for a course
 ...
 Usually used in context of databases
50
Transaction Processing Issues
 Transaction structure
 Flat vs Nested vs Distributed
 Internal database consistency
 Semantic data control and integrity enforcement
 Reliability protocols
 Atomicity and durability
 Local recovery protocols
 Global commit protocols
 Concurrency control algorithms
 Replica control protocols
1 MCS 5.1
51
Transaction execution
1 MCS 5.1
52
Nested vs Distributed Transactions
1 MCS 5.1
53
Distributed Transaction execution
1 MCS 5.1
1 MCS 5.1 54
Definition – AtomicTransaction
 A transaction that happens completely or
not at all
 No partial results
 Example:
 Cash machine hands you cash and deducts amount
from your account
 Airline confirms your reservation and
 Reduces number of free seats
 Charges your credit card
 (Sometimes) increases number of meals loaded on flight
 …
1 MCS 5.1 55
Atomic Transaction Review
 Fundamental principles – A C I D
◦ Atomicity – to outside world, transaction
happens indivisibly
◦ Consistency – transaction preserves system
invariants
◦ Isolated – transactions do not interfere with
each other
◦ Durable – once a transaction “commits,” the
changes are permanent
1 MCS 5.1 56
Programming in a Transaction
System
 Begin_transaction
 Mark the start of a transaction
 End_transaction
 Mark the end of a transaction and try to “commit”
 Abort_transaction
 Terminate the transaction and restore old values
 Read
 Read data from a file, table, etc., on behalf of the transaction
 Write
 Write data to file, table, etc., on behalf of the transaction
1 MCS 5.1 57
Programming in a Transaction System
(continued)
 As a matter of practice, separate
transactions are handled in separate threads
or processes
 Isolated property means that two concurrent
transactions are serialized
 I.e., they run in some indeterminate order with respect
to each other
1 MCS 5.1 58
Programming in a Transaction System
(continued)
 NestedTransactions
 One or more transactions inside another
transaction
 May individually commit, but may need to be
undone
 Example
 Planning a trip involving three flights
 Reservation for each flight “commits” individually
 Must be undone if entire trip cannot commit
1 MCS 5.1 59
Tools for Implementing AtomicTransactions
(single system)
 Stable storage
 i.e., write to disk “atomically”
 Log file
 i.e., record actions in a log before “committing”
them
 Log in stable storage
 Locking protocols
 Serialize Read and Write operations of same data by
separate transactions
 …
1 MCS 5.1 60
Tools for Implementing AtomicTransactions
(continued)
 Begin_transaction
 Place a begin entry in log
 Write
 Write updated data to log
 Abort_transaction
 Place abort entry in log
 End_transaction (i.e., commit)
 Place commit entry in log
 Copy logged data to files
 Place done entry in log
1 MCS 5.1 61
Tools for Implementing AtomicTransactions
(continued)
 Crash recovery – search log
 If begin entry, look for matching entries
 If done, do nothing (all files have been
updated)
 If abort, undo any permanent changes that
transaction may have made
 If commit but not done, copy updated
blocks from log to files, then add done
entry
62
Distributed ACID
 Global Atomicity: All sub transactions of a
distributed transaction must commit or all
must abort.
 An atomic commit protocol, initiated by a coordinator
(e.g., the transaction manager), ensures this.
 Coordinator must poll cohorts to determine if they are all
willing to commit.
 Global deadlocks: there must be no deadlocks
involving multiple sites
 Global serialization: distributed transaction
must be globally serializable
1 MCS 5.1
1 MCS 5.1 63
Distributed Atomic Transactions
 Atomic transactions that span multiple
sites and/or systems
 Same semantics as atomic transactions on
single system
 A C I D
 Failure modes
 Crash or other failure of one site or system
 Network failure or partition
 Byzantine failures
64
2PC phases
1 MCS 5.1
65
Distributed 2PC
 The Coordinator initiates 2PC
 The participants run a distributed algorithm to
reach the agreement of global commit or abort.
1 MCS 5.1
1 MCS 5.1 66
Two-Phase Commit
 One site is elected coordinator of the
transaction T
 Using Election algorithms
 Phase 1: When coordinator is ready to
commit the transaction
 Place Prepare(T) state in log on stable storage
 Send Vote_request(T) message to all other
participants
 Wait for replies
1 MCS 5.1 67
Two-Phase Commit (continued)
 Phase 2: Coordinator
◦ If any participant replies Abort(T)
 Place Abort(T) state in log on stable storage
 Send Global_Abort(T) message to all participants
 Locally abort transaction T
◦ If all participants reply Ready_to_commit(T)
 Place Commit(T) state in log on stable storage
 Send Global_Commit(T) message to all participants
 Proceed to commit transaction locally
1 MCS 5.1 68
Two-Phase Commit (continued)
 Phase I: Participant gets Vote_request(T)
from coordinator
 Place Abort(T) or Ready(T) state in local log
 Reply with Abort(T) or Ready_to_commit(T) message
to coordinator
 If Abort(T) state, locally abort transaction
 Phase II: Participant
 Wait for Global_Abort(T) or Global_Commit(T)
message from coordinator
 Place Abort(T) or Commit(T) state in local log
 Abort or commit locally per message
1 MCS 5.1 69
Two-Phase Commit States
coordinator participant
PREPARE
1 MCS 5.1 70
Failure Recovery – Two-Phase
Commit
 Failure modes (from coordinator’s point of view)
◦ Own crash
◦ Wait state: No response from some
participant to Vote_request message
 Failure modes (from participant’s point of view)
◦ Own crash
◦ Ready state: No message from coordinator to
Global_Abort(T) or Global_Commit(T)
1 MCS 5.1 71
Lack of Response to Coordinator
Vote_Request(T) message
 E.g.,
◦ participant crash
◦ Network failure
 Timeout is considered equivalent to Abort
◦ Place Abort(T) state in log on stable storage
◦ Send Global_Abort(T) message to all
participants
◦ Locally abort transaction T
1 MCS 5.1 72
Coordinator Crash
 Inspect Log
 If Abort or Commit state
◦ Resend corresponding message
◦ Take corresponding local action
 If Prepare state, either
◦ Resend Vote_request(T) to all other participants and
wait for their responses; or
◦ Unilaterally abort transaction
 I.e., put Abort(T) in own log on stable store
 Send Global_Abort(T) message to all participants
 If nothing in log, abort transaction as above
1 MCS 5.1 73
No Response to Participant’s
Ready_to_commit(T) message
 Re-contact coordinator, ask what to do
 If unable to contact coordinator, contact other
participants, ask if they know
 If any other participant is in Abort or Commit
state
 Take equivalent action
 Otherwise, wait for coordinator to restart!
◦ Participants are blocked, unable to go forward or
back
◦ Frozen in Ready state!
1 MCS 5.1 74
Participant Crash
 Inspect local log
◦ Commit state:
 Redo/replay the transaction
◦ Abort state:
 Undo/abort the transaction
◦ No records about T:
 Same as local_abort(T)
◦ Ready State:
 Same as no response to Ready_to_commit(T) message
1 MCS 5.1 75
Two-Phase Commit Summary
 Widely used in distributed transaction
and database systems
 Generally works well
◦ When coordinators are likely to reboot
quickly
◦ When network partition is likely to end
quickly
 Still subject to participant blocking
1 MCS 5.1 76
Three-Phase Commit
 Minor variation
 Widely quoted in literature
 Rarely implemented
 Because indefinite blocking due to coordinator
failures doesn’t happen very often in real life!
1 MCS 5.1 77
PREPARE
Three-Phase Commit (continued)
 There is no state from which a transition can be
made to either Commit or Abort
 There is no state where it is not possible to make
a final decision and from which transition can be
made to Commit.
1 MCS 5.1 78
Three-Phase Commit (continued)
 Coordinator sends Vote_Request (as
before)
 If all participants respond affirmatively,
 Put Precommit state into log on stable storage
 Send out Prepare_to_Commit message to all
 After all participants acknowledge,
 Put Commit state in log
 Send out Global_Commit
1 MCS 5.1 79
Three-Phase Commit Failures
 Coordinator blocked in Ready state
 Safe to abort transaction
 Coordinator blocked in Precommit state
 Safe to issue Global_Commit
 Any crashed or partitioned participants will commit
when recovered
 …
1 MCS 5.1 80
Three-Phase Commit Failures
(continued)
 Participant blocked in Precommit state
 Contact others
 Collectively decide to commit
 Participant blocked in Ready state
 Contact others
 If any in Abort, then abort transaction
 If any in Precommit, the move to Precommit state
 …
1 MCS 5.1 81
Three-Phase Commit Summary
 If any processes are in Precommit state,
then all crashed processes will recover to
 Ready, Precommit, or Committed states
 If any process is in Ready state, then all
other crashed processes will recover to
 Init, Abort, or Precommit
 Surviving processes can make collective decision

Weitere ähnliche Inhalte

Was ist angesagt?

2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software conceptsPrajakta Rane
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 
Security in distributed systems
Security in distributed systems Security in distributed systems
Security in distributed systems Haitham Ahmed
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed SystemsRupsee
 
Election algorithms
Election algorithmsElection algorithms
Election algorithmsAnkush Kumar
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed SystemsDr Sandeep Kumar Poonia
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Distributed & parallel system
Distributed & parallel systemDistributed & parallel system
Distributed & parallel systemManish Singh
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 

Was ist angesagt? (20)

Distributed Operating System_4
Distributed Operating System_4Distributed Operating System_4
Distributed Operating System_4
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Stream oriented communication
Stream oriented communicationStream oriented communication
Stream oriented communication
 
Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
Security in distributed systems
Security in distributed systems Security in distributed systems
Security in distributed systems
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Election algorithms
Election algorithmsElection algorithms
Election algorithms
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed Systems
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Distributed & parallel system
Distributed & parallel systemDistributed & parallel system
Distributed & parallel system
 
message passing
 message passing message passing
message passing
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 

Ähnlich wie 8. mutual exclusion in Distributed Operating Systems

DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdfDC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdfLegesseSamuel
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .pptSOURAVKUMAR723356
 
Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Govt. P.G. College Dharamshala
 
Mutual Exclusion in Distributed Memory Systems
Mutual Exclusion in Distributed Memory SystemsMutual Exclusion in Distributed Memory Systems
Mutual Exclusion in Distributed Memory SystemsDilum Bandara
 
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 SystemsIJERA Editor
 
Mutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptMutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptShikhaManrai1
 
Distributed computing
Distributed  computingDistributed  computing
Distributed computingSwetha544947
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algosAkhil Sharma
 
Unit_5_Distributed Mutual Exclusion.pdf
Unit_5_Distributed Mutual Exclusion.pdfUnit_5_Distributed Mutual Exclusion.pdf
Unit_5_Distributed Mutual Exclusion.pdfDr.Somnath Thigale
 
Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)WajeehaBaig
 
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 siddikSaeed Siddik
 
Module 3 (1).pptx
Module 3 (1).pptxModule 3 (1).pptx
Module 3 (1).pptxAmalMR4
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsguest0f5a7d
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OSC.U
 

Ähnlich wie 8. mutual exclusion in Distributed Operating Systems (20)

DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdfDC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .ppt
 
Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...
 
Mutual Exclusion in Distributed Memory Systems
Mutual Exclusion in Distributed Memory SystemsMutual Exclusion in Distributed Memory Systems
Mutual Exclusion in Distributed Memory Systems
 
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
 
Mutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptMutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.ppt
 
Distributed computing
Distributed  computingDistributed  computing
Distributed computing
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algos
 
Unit_5_Distributed Mutual Exclusion.pdf
Unit_5_Distributed Mutual Exclusion.pdfUnit_5_Distributed Mutual Exclusion.pdf
Unit_5_Distributed Mutual Exclusion.pdf
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)
 
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
 
Module 3 (1).pptx
Module 3 (1).pptxModule 3 (1).pptx
Module 3 (1).pptx
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
 
OSCh17
OSCh17OSCh17
OSCh17
 
OS_Ch17
OS_Ch17OS_Ch17
OS_Ch17
 
Chapter00000000
Chapter00000000Chapter00000000
Chapter00000000
 

Mehr von Dr Sandeep Kumar Poonia

An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmDr Sandeep Kumar Poonia
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithmDr Sandeep Kumar Poonia
 
Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmDr Sandeep Kumar Poonia
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmDr Sandeep Kumar Poonia
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsDr Sandeep Kumar Poonia
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmDr Sandeep Kumar Poonia
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm Dr Sandeep Kumar Poonia
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Dr Sandeep Kumar Poonia
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Dr Sandeep Kumar Poonia
 

Mehr von Dr Sandeep Kumar Poonia (20)

Soft computing
Soft computingSoft computing
Soft computing
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithm
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithm
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithm
 
RMABC
RMABCRMABC
RMABC
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithm
 
Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithm
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithm
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm
 
A new approach of program slicing
A new approach of program slicingA new approach of program slicing
A new approach of program slicing
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...
 
Enhanced abc algo for tsp
Enhanced abc algo for tspEnhanced abc algo for tsp
Enhanced abc algo for tsp
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
 
Lecture26
Lecture26Lecture26
Lecture26
 

Kürzlich hochgeladen

𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...rahim quresi
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna... Shivani Pandey
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingNitya salvi
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Bookingnoor ahmed
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Riya Pathan
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Serviceanamikaraghav4
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...noor ahmed
 
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...ritikasharma
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...ritikasharma
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448ont65320
 
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...ritikasharma
 
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...anamikaraghav4
 
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 

Kürzlich hochgeladen (20)

𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
 
Call Girls Chirag Delhi Delhi WhatsApp Number 9711199171
Call Girls Chirag Delhi Delhi WhatsApp Number 9711199171Call Girls Chirag Delhi Delhi WhatsApp Number 9711199171
Call Girls Chirag Delhi Delhi WhatsApp Number 9711199171
 
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
Russian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In GoaRussian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In Goa
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
 
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
 
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
 
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
 

8. mutual exclusion in Distributed Operating Systems

  • 1. Distributed Operating Systems Sandeep Kumar Poonia Head of Dept. CS/IT B.E., M.Tech., UGC-NET LM-IAENG, LM-IACSIT,LM-CSTA, LM-AIRCC, LM-SCIEI, AM-UACEE
  • 2. 1 MCS 5.1 2 •Mutual Exclusion •Election Algorithms •AtomicTransactions in Distributed Systems
  • 3. Process Synchronization Techniques to coordinate execution among processes ◦ One process may have to wait for another ◦ Shared resource (e.g. critical section) may require exclusive access 1 MCS 5.1 3
  • 4. What is mutual exclusion?  When a process is accessing a shared variable, the process is said to be in a CS (critical section).  No two process can be in the same CS at the same time. This is called mutual exclusion. 1 MCS 5.1 4
  • 5. Distributed Mutual Exclusion  Assume there is agreement on how a resource is identified ◦ Pass identifier with requests  Create an algorithm to allow a process to obtain exclusive access to a resource 1 MCS 5.1 5
  • 6. Distributed Mutual Exclusion  Centralized Algorithm  Token Ring Algorithm  Distributed Algorithm  Decentralized Algorithm 1 MCS 5.1 6
  • 7. Centralized algorithm  Mimic single processor system  One process elected as coordinator P C request(R) grant(R) 1. Request resource 2. Wait for response 3. Receive grant 4. access resource 5. Release resource release(R) 1 MCS 5.1 7
  • 8. Centralized algorithm If another process claimed resource: ◦ Coordinator does not reply until release ◦ Maintain queue  Service requests in FIFO order P0 C request(R) grant(R) release(R) P1 P2 request(R) Queue P1 request(R) P2 grant(R) 1 MCS 5.1 8
  • 9. ADVANTAGES: 1 MCS 5.1 9 Mutual exclusion can be achieved. The coordinator lets only one process at a time into each CS. It is fair. Requests are granted in the order in which they are received. No process waits forever. Easy to implement. It can be used for general resource allocation rather than just managing mutual exclusion.
  • 10. DISADVANTAGES  The coordinator is a single point of failure, so if it crashes, the entire system may go down.  If process normally block after making a request, they cannot distinguish a dead coordinator from "access denied" since in both cases coordinator doesn't reply.  In a large system, a single coordinator has to take care of all process. 1 MCS 5.1 10
  • 11. Token Ring algorithm Assume known group of processes ◦ Some ordering can be imposed on group ◦ Construct logical ring in software ◦ Process communicates with neighbor P0 P1 P2 P3 P4 P5 1 MCS 5.1 11
  • 12. Token Ring algorithm  Initialization ◦ Process 0 gets token for resource R  Token circulates around ring  When process acquires token ◦ Checks to see if it needs to enter critical section ◦ If no, send token to neighbor ◦ If yes, access resource  Hold token until done P0 P1 P2 P3 P4 P5 token(R) 1 MCS 5.1 12
  • 13. Token Ring algorithm  Only one process at a time has token ◦ Mutual exclusion guaranteed  Order well-defined ◦ Starvation cannot occur  If token is lost (e.g. process died) ◦ It will have to be regenerated  Does not guarantee FIFO order ◦ sometimes this is undesirable 1 MCS 5.1 13
  • 14. ADVANTAGES  The correctness of this algorithm is evident. Only one process has the token at any instant, so only one process can be in a CS.  Since the token circulates among processes in a well-defined order, starvation cannot occur. 1 MCS 5.1 14
  • 15. DISADVANTAGES  Once a process decides it wants to enter a CS, at worst it will have to wait for every other process to enter and leave one critical region.  If the token is ever lost, it must be regenerated. In fact, detecting that it is lost is difficult, since the amount of time between successive appearances of the token on the network is not a constant. The fact that the token has not been spotted for an hour does not mean that it has been lost; some process may still be using it. 1 MCS 5.1 15
  • 16. DISADVANTAGES…………  The algorithm also runs into trouble if a process crashes, but recovery is easier than in the other cases.  If we require a process receiving the token to acknowledge receipt, a dead process will be detected when its neighbor tries to give it the token and fails. At that point the dead process can be removed from the group, and the token holder can pass the token to the next member down the line. 1 MCS 5.1 16
  • 17. Ricart & Agrawala algorithm  Distributed algorithm using reliable multicast and logical clocks  Process wants to enter critical section: ◦ Compose message containing:  Identifier (machine ID, process ID)  Name of resource  Timestamp (totally-ordered Lamport) ◦ Send request to all processes in group ◦ Wait until everyone gives permission ◦ Enter critical section / use resource 1 MCS 5.1 17
  • 18. Ricart & Agrawala algorithm  When process receives request: ◦ If receiver not interested:  Send OK to sender ◦ If receiver is in critical section  Do not reply; add request to queue ◦ If receiver just sent a request as well:  Compare timestamps: received & sent messages  Earliest wins  If receiver is loser, send OK  If receiver is winner, do not reply, queue  When done with critical section ◦ Send OK to all queued requests 1 MCS 5.1 18
  • 19. Ricart & Agrawala algorithm  N points of failure  A lot of messaging traffic  Demonstrates that a fully distributed algorithm is possible 1 MCS 5.1 19
  • 20. ADVANTAGES  Mutual exclusion can be achieved without deadlock or starvation.  The number of messages required per entry into CS is 2(n-1), where the total number of process in the system is n.  All processes are involved in all decisions. 1 MCS 5.1 20
  • 21. DISADVANTAGES  Unfortunately, the single point of failure has been replaced by n points of failure.  If any process crashes, it will fail to respond to requests.  This silence will be interpreted incorrectly as denial of permission.  Since the chance of one of the n process failing is n times the single coordinator failing, we have devised an algorithm which is n times worse than the centralized algorithm.  Each process must maintain the group membership list itself, including processes entering the group, leaving the group and crashing.  This algorithm is slower, more complicated, more expensive and less robust than the origianl centralized one. 1 MCS 5.1 21
  • 22. Lamport’s Mutual Exclusion Each process maintains request queue ◦ Contains mutual exclusion requests Requesting critical section: ◦ Process Pi sends request(i, Ti) to all nodes ◦ Places request on its own queue ◦ When a process Pj receives a request, it returns a timestamped ack Lamport time 1 MCS 5.1 22
  • 23. Lamport’s Mutual Exclusion Entering critical section (accessing resource): ◦ Pi received a message (ack or release) from every other process with a timestamp larger thanTi ◦ Pi’s request has the earliest timestamp in its queue Difference from Ricart-Agrawala: ◦ Everyone responds … always - no hold-back ◦ Process decides to go based on whether its request is the earliest in its queue 1 MCS 5.1 23
  • 24. Lamport’s Mutual Exclusion Releasing critical section: ◦ Remove request from its own queue ◦ Send a timestamped release message ◦ When a process receives a release message  Removes request for that process from its queue  This may cause its own entry have the earliest timestamp in the queue, enabling it to access the critical section 1 MCS 5.1 24
  • 25. Characteristics of Decentralized Algorithms  No machine has complete information about the system state  Machines make decisions based only on local information  Failure of one machine does not ruin the algorithm  Three is no implicit assumption that a global clock exists 1 MCS 5.1 25
  • 26. Decentralized Algorithm  Based on the Distributed HashTable (DHT) system structure previously introduced ◦ Peer-to-peer ◦ Object names are hashed to find the successor node that will store them  Here, we assume that n replicas of each object are stored 1 MCS 5.1 26
  • 27. Placing the Replicas  The resource is known by a unique name: rname ◦ Replicas: rname-0, rname-I, …, rname-(n-1) ◦ rname-i is stored at succ(rname-i), where names and site names are hashed as before ◦ If a process knows the name of the resource it wishes to access, it also can generate the hash keys that are used to locate all the replicas 1 MCS 5.1 27
  • 28. The Decentralized Algorithm  Every replica has a coordinator that controls access to it (the coordinator is the node that stores it)  For a process to use the resource it must receive permission from m > n/2 coordinators  This guarantees exclusive access as long as a coordinator only grants access to one process at a time 1 MCS 5.1 28
  • 29. The Decentralized Algorithm  The coordinator notifies the requester when it has been denied access as well as when it is granted ◦ Requester must “count the votes”, and decide whether or not overall permission has been granted or denied  If a processor (requester) gets fewer than m votes it will wait for a random time and then ask again 1 MCS 5.1 29
  • 30. Analysis  If a resource is in high demand, multiple requests will be generated  It’s possible that processes will wait a long time to get permission  Deadlock?  Resource usage drops 1 MCS 5.1 30
  • 31. Analysis  More robust than the central coordinator approach. If one coordinator goes down others are available. ◦ If a coordinator fails and resets then it will not remember having granted access to one requestor, and may then give access to another. According to the authors, it is highly unlikely that this will lead to a violation of mutual exclusion. 1 MCS 5.1 31
  • 32. 1 MCS 5.1 32
  • 33. Election Algorithms  If we are using one process as a coordinator for a shared resource …  …how do we select that one process? 331 MCS 5.1
  • 34. Solution – an Election  All nodes currently involved get together to choose a coordinator  If the coordinator crashes or becomes isolated, elect a new coordinator  If a previously crashed or isolated node, comes on line, a new election may have to be held 341 MCS 5.1
  • 35. Election Algorithms  Wired systems  Bully algorithm  Ring algorithm  Wireless systems  Very large-scale systems 351 MCS 5.1
  • 36. Bully Algorithm • Assume • All processes know about each other • Processes numbered uniquely • They do not know each other’s state • Suppose P notices no coordinator • Sends election message to all higher numbered processes • If none response, P takes over as coordinator • If any responds, P yields • … 361 MCS 5.1
  • 37. Bully Algorithm (continued)  …  Suppose Q receives election message  Replies OK to sender, saying it will take over  Sends a new election message to higher numbered processes  Repeat until only one process left standing  Announces victory by sending message saying that it is the coordinator 371 MCS 5.1
  • 39. Bully Algorithm (continued)  …  Suppose R comes back on line  Sends a new election message to higher numbered processes  Repeat until only one process left standing  Announces victory by sending message saying that it is the coordinator (if not already the coordinator)  Existing (lower numbered) coordinator yields  Hence the term “bully” 391 MCS 5.1
  • 40. Alternative – Ring Algorithm  All processes organized in ring  Independent of process number  Suppose P notices no coordinator  Sends election message to successor with own process number in body of message  (If successor is down, skip to next process, etc.)  Suppose Q receives an election message  Adds own process number to list in message body  … 401 MCS 5.1
  • 41. Alternative – Ring Algorithm  Suppose P receives an election message with its own process number in body  Changes message to coordinator message, preserving body  All processes recognize highest numbered process as new coordinator  If multiple messages circulate …  …they will all contain same list of processes (eventually)  If process comes back on-line  Calls new election 411 MCS 5.1
  • 43. Wireless Environments • Unreliable, and nodes may move • Network topology constantly changing • Algorithm: 1. Any node starts by sending out an ELECTION message to neighbors 2. When a node receives an ELECTION message for the first time, it forwards to neighbors, and designates the sender as its parent 3. It then waits for responses from is neighbors • Responses may carry resource information 4. When a node receives an ELECTION message for the second time, it just OKs it 1 MCS 5.1 43
  • 45. Elections in Wireless Environment (e)The build-tree phase. (f) Reporting of best node to source. c c 1 MCS 5.1 45
  • 46. Very Large Scale Networks  Sometimes more than one node should be selected  Nodes organized as peers and super-peers  Elections held within each peer group  Super-peers coordinate among themselves 461 MCS 5.1
  • 47. 1 MCS 5.1 47
  • 48. 48  OS Processes  DBMS Transactions  A collection of actions that make consistent transformation of system states while preserving consistency  Termination of transactions – commit vs abort  Example: T : x = x + y R(x) Read(x) W(x) C Read(y) R(y) Write(x) Commit 1 MCS 5.1
  • 49. 1 MCS 5.1 49 Definition – Transaction  A sequence of operations that perform a single logical function  Examples  Withdrawing money from your account  Making an airline reservation  Making a credit-card purchase  Registering for a course  ...  Usually used in context of databases
  • 50. 50 Transaction Processing Issues  Transaction structure  Flat vs Nested vs Distributed  Internal database consistency  Semantic data control and integrity enforcement  Reliability protocols  Atomicity and durability  Local recovery protocols  Global commit protocols  Concurrency control algorithms  Replica control protocols 1 MCS 5.1
  • 52. 52 Nested vs Distributed Transactions 1 MCS 5.1
  • 54. 1 MCS 5.1 54 Definition – AtomicTransaction  A transaction that happens completely or not at all  No partial results  Example:  Cash machine hands you cash and deducts amount from your account  Airline confirms your reservation and  Reduces number of free seats  Charges your credit card  (Sometimes) increases number of meals loaded on flight  …
  • 55. 1 MCS 5.1 55 Atomic Transaction Review  Fundamental principles – A C I D ◦ Atomicity – to outside world, transaction happens indivisibly ◦ Consistency – transaction preserves system invariants ◦ Isolated – transactions do not interfere with each other ◦ Durable – once a transaction “commits,” the changes are permanent
  • 56. 1 MCS 5.1 56 Programming in a Transaction System  Begin_transaction  Mark the start of a transaction  End_transaction  Mark the end of a transaction and try to “commit”  Abort_transaction  Terminate the transaction and restore old values  Read  Read data from a file, table, etc., on behalf of the transaction  Write  Write data to file, table, etc., on behalf of the transaction
  • 57. 1 MCS 5.1 57 Programming in a Transaction System (continued)  As a matter of practice, separate transactions are handled in separate threads or processes  Isolated property means that two concurrent transactions are serialized  I.e., they run in some indeterminate order with respect to each other
  • 58. 1 MCS 5.1 58 Programming in a Transaction System (continued)  NestedTransactions  One or more transactions inside another transaction  May individually commit, but may need to be undone  Example  Planning a trip involving three flights  Reservation for each flight “commits” individually  Must be undone if entire trip cannot commit
  • 59. 1 MCS 5.1 59 Tools for Implementing AtomicTransactions (single system)  Stable storage  i.e., write to disk “atomically”  Log file  i.e., record actions in a log before “committing” them  Log in stable storage  Locking protocols  Serialize Read and Write operations of same data by separate transactions  …
  • 60. 1 MCS 5.1 60 Tools for Implementing AtomicTransactions (continued)  Begin_transaction  Place a begin entry in log  Write  Write updated data to log  Abort_transaction  Place abort entry in log  End_transaction (i.e., commit)  Place commit entry in log  Copy logged data to files  Place done entry in log
  • 61. 1 MCS 5.1 61 Tools for Implementing AtomicTransactions (continued)  Crash recovery – search log  If begin entry, look for matching entries  If done, do nothing (all files have been updated)  If abort, undo any permanent changes that transaction may have made  If commit but not done, copy updated blocks from log to files, then add done entry
  • 62. 62 Distributed ACID  Global Atomicity: All sub transactions of a distributed transaction must commit or all must abort.  An atomic commit protocol, initiated by a coordinator (e.g., the transaction manager), ensures this.  Coordinator must poll cohorts to determine if they are all willing to commit.  Global deadlocks: there must be no deadlocks involving multiple sites  Global serialization: distributed transaction must be globally serializable 1 MCS 5.1
  • 63. 1 MCS 5.1 63 Distributed Atomic Transactions  Atomic transactions that span multiple sites and/or systems  Same semantics as atomic transactions on single system  A C I D  Failure modes  Crash or other failure of one site or system  Network failure or partition  Byzantine failures
  • 65. 65 Distributed 2PC  The Coordinator initiates 2PC  The participants run a distributed algorithm to reach the agreement of global commit or abort. 1 MCS 5.1
  • 66. 1 MCS 5.1 66 Two-Phase Commit  One site is elected coordinator of the transaction T  Using Election algorithms  Phase 1: When coordinator is ready to commit the transaction  Place Prepare(T) state in log on stable storage  Send Vote_request(T) message to all other participants  Wait for replies
  • 67. 1 MCS 5.1 67 Two-Phase Commit (continued)  Phase 2: Coordinator ◦ If any participant replies Abort(T)  Place Abort(T) state in log on stable storage  Send Global_Abort(T) message to all participants  Locally abort transaction T ◦ If all participants reply Ready_to_commit(T)  Place Commit(T) state in log on stable storage  Send Global_Commit(T) message to all participants  Proceed to commit transaction locally
  • 68. 1 MCS 5.1 68 Two-Phase Commit (continued)  Phase I: Participant gets Vote_request(T) from coordinator  Place Abort(T) or Ready(T) state in local log  Reply with Abort(T) or Ready_to_commit(T) message to coordinator  If Abort(T) state, locally abort transaction  Phase II: Participant  Wait for Global_Abort(T) or Global_Commit(T) message from coordinator  Place Abort(T) or Commit(T) state in local log  Abort or commit locally per message
  • 69. 1 MCS 5.1 69 Two-Phase Commit States coordinator participant PREPARE
  • 70. 1 MCS 5.1 70 Failure Recovery – Two-Phase Commit  Failure modes (from coordinator’s point of view) ◦ Own crash ◦ Wait state: No response from some participant to Vote_request message  Failure modes (from participant’s point of view) ◦ Own crash ◦ Ready state: No message from coordinator to Global_Abort(T) or Global_Commit(T)
  • 71. 1 MCS 5.1 71 Lack of Response to Coordinator Vote_Request(T) message  E.g., ◦ participant crash ◦ Network failure  Timeout is considered equivalent to Abort ◦ Place Abort(T) state in log on stable storage ◦ Send Global_Abort(T) message to all participants ◦ Locally abort transaction T
  • 72. 1 MCS 5.1 72 Coordinator Crash  Inspect Log  If Abort or Commit state ◦ Resend corresponding message ◦ Take corresponding local action  If Prepare state, either ◦ Resend Vote_request(T) to all other participants and wait for their responses; or ◦ Unilaterally abort transaction  I.e., put Abort(T) in own log on stable store  Send Global_Abort(T) message to all participants  If nothing in log, abort transaction as above
  • 73. 1 MCS 5.1 73 No Response to Participant’s Ready_to_commit(T) message  Re-contact coordinator, ask what to do  If unable to contact coordinator, contact other participants, ask if they know  If any other participant is in Abort or Commit state  Take equivalent action  Otherwise, wait for coordinator to restart! ◦ Participants are blocked, unable to go forward or back ◦ Frozen in Ready state!
  • 74. 1 MCS 5.1 74 Participant Crash  Inspect local log ◦ Commit state:  Redo/replay the transaction ◦ Abort state:  Undo/abort the transaction ◦ No records about T:  Same as local_abort(T) ◦ Ready State:  Same as no response to Ready_to_commit(T) message
  • 75. 1 MCS 5.1 75 Two-Phase Commit Summary  Widely used in distributed transaction and database systems  Generally works well ◦ When coordinators are likely to reboot quickly ◦ When network partition is likely to end quickly  Still subject to participant blocking
  • 76. 1 MCS 5.1 76 Three-Phase Commit  Minor variation  Widely quoted in literature  Rarely implemented  Because indefinite blocking due to coordinator failures doesn’t happen very often in real life!
  • 77. 1 MCS 5.1 77 PREPARE Three-Phase Commit (continued)  There is no state from which a transition can be made to either Commit or Abort  There is no state where it is not possible to make a final decision and from which transition can be made to Commit.
  • 78. 1 MCS 5.1 78 Three-Phase Commit (continued)  Coordinator sends Vote_Request (as before)  If all participants respond affirmatively,  Put Precommit state into log on stable storage  Send out Prepare_to_Commit message to all  After all participants acknowledge,  Put Commit state in log  Send out Global_Commit
  • 79. 1 MCS 5.1 79 Three-Phase Commit Failures  Coordinator blocked in Ready state  Safe to abort transaction  Coordinator blocked in Precommit state  Safe to issue Global_Commit  Any crashed or partitioned participants will commit when recovered  …
  • 80. 1 MCS 5.1 80 Three-Phase Commit Failures (continued)  Participant blocked in Precommit state  Contact others  Collectively decide to commit  Participant blocked in Ready state  Contact others  If any in Abort, then abort transaction  If any in Precommit, the move to Precommit state  …
  • 81. 1 MCS 5.1 81 Three-Phase Commit Summary  If any processes are in Precommit state, then all crashed processes will recover to  Ready, Precommit, or Committed states  If any process is in Ready state, then all other crashed processes will recover to  Init, Abort, or Precommit  Surviving processes can make collective decision