SlideShare a Scribd company logo
DISTRIBUTED OPERATING
SYSTEMS
By:Little Goku
CANONICAL PROBLEMS IN DISTRIBUTED SYSTEMS
 Time ordering and clock synchronization
 Election
 Mutual exclusion
 Distributed transactions
THE IMPORTANCE OF SYNCHRONIZATION
 Because various components of a distributed
system must cooperate and exchange information,
synchronization is a necessity.
 Constraints, both implicit and explicit, are therefore
enforced to ensure synchronization of components.
CLOCK SYNCHRONIZATION
 As in non-distributed systems, the knowledge
of “when events occur” is necessary.
 However, clock synchronization is often more
difficult in distributed systems because there
is no ideal time source.
 Distributed algorithms must overcome:
 Scattering of information
 Local, rather than global, decision-making.
Conti....
 Time is unambiguous in centralized systems
 Distributed systems: each node has own
system clock.
 Crystal-based clocks are less accurate (1 part in
million)
 Problem: An event that occurred after another
may be assigned an earlier time
LACK OF GLOBAL TIME IN DS (Clock syn.)
 It is impossible to guarantee that
physical clocks run at the same
frequency
 Lack of global time, can cause problem.
 Example: UNIX make
 Edit output.c at a client
 output.o is at a server (compile at server)
 Client machine clock can be lagging behind
the server machine clock
LACK OF GLOBAL TIME – EXAMPLE
When each machine has its own clock, an
event that occurred after another event may
nevertheless be assigned an earlier time.
LOGICAL CLOCKS
 Often, it is not necessary for a computer to know the exact
time, only relative time. This is known as “logical time”.
 Logical time is not based on timing but on the ordering of
events.
 Logical clocks can only advance forward, not in reverse.
 Non-interacting processes cannot share a logical clock.
 Computers generally obtain logical time using interrupts to
update a software clock. The more interrupts (the more
frequently time is updated), the higher the overhead.
LAMPORT’S LOGICAL CLOCK
SYNCHRONIZATION ALGORITHM
 The most common logical clock synchronization algorithm
for distributed systems is Lamport‟s Algorithm. It is used in
situations where ordering is important but global time is not
required.
 Based on the “happens-before” relation:
 Event A “happens-before” Event B (A→B) when all
processes involved in a distributed system agree that
event A occurred first, and B subsequently occurred.
 This DOES NOT mean that Event A actually occurred
before Event B in absolute clock time.
LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION
ALGORITHM
 A distributed system can use the “happens-before”
relation when:
 Events A and B are observed by the same
process, or by multiple processes with the same
global clock
 Event A acknowledges sending a message and
Event B acknowledges receiving it, since a
message cannot be received before it is sent
 If two events do not communicate via messages,
they are considered concurrent – because order
cannot be determined and it does not matter.
Concurrent events can be ignored.
LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION
ALGORITHM (CONT.)
 In the previous examples, Clock C(a) < C(b)
 If they are concurrent, C(a) = C(b)
 Concurrent events can only occur on the same system,
because every message transfer between two systems
takes at least one clock tick.
 In Lamport‟s Algorithm, logical clock values for events may
be changed, but always by moving the clock forward. Time
values can never be decreased.
LAMPORT’S LOGICAL CLOCK
SYNCHRONIZATION ALGORITHM (CONT.)
 Lamport‟s Algorithm can thus be used in distributed
systems to ensure synchronization:
 A logical clock is implemented in each node in
the system.
 Each node can determine the order in which
events have occurred in that system’s own point
of view.
 The logical clock of one node does not need to
have any relation to real time or to any other
node in the system.
PROCESS EACH WITH ITS OWN CLOCK
•At time 6 , Process 0 sends message A to Process 1
•It arrives to Process 1 at 16( It took 10 ticks to make journey
•Message B from 1 to 2 takes 16 ticks
•Message C from 2 to 1 leaves at
60 and arrives at 56 -Not Possible
•Message D from 1 to 0 leaves at
64 and arrives at 54 -Not Possible
LAMPORT’S ALGORITHM CORRECTS THE CLOCKS
 Use „happened-before‟
relation
 Each message carries the
sending time (as per sender‟s
clock)
 When arrives, receiver fast
forwards its clock to be one
more than the sending time.
(between every two events,
the clock must tick at least
once)
PHYSICAL CLOCKS
 The time difference between two computers is known as
drift. Clock drift over time is known as skew. Computer
clock manufacturers specify a maximum skew rate in their
products.
 Computer clocks are among the least accurate modern
timepieces.
 Inside every computer is a chip surrounding a quartz
crystal oscillator to record time. These crystals cost 25
seconds to produce.
 Average loss of accuracy: 0.86 seconds per day
 This skew is unacceptable for distributed systems. Several
methods are now in use to attempt the synchronization of
physical clocks in distributed systems:
PHYSICAL CLOCKS
 17th Century: time has been measured
astronomically
 Solar Day: interval between two consecutive
transit of sun
 Solar Second: 1/86400th of solar day
PHYSICAL CLOCKS
 1948: Atomic Clocks are invented
 Accurate clocks are atomic oscillators (one part in 1013)
 BIH decide TAI(International Atomic Time)
 TAI seconds is now about 3 msec less than solar day
 BIH solves the problem by introducing leap seconds
Whenever discrepancy between TAI and solar time grow to
800 msec
 This time is called Universal Coordinated Time(UTC)
 When BIH announces leap second, the power companies
raise their frequency to 61 & 51 Hz for 60 & 50 sec, to
advance all the clocks in their distribution area.
PHYSICAL CLOCKS - UTC
Coordinated Universal Time
(UTC) is the international
time standard.
UTC is the current term for
what was commonly
referred to as Greenwich
Mean Time (GMT).
Zero hours UTC is midnight in
Greenwich, England, which
lies on the zero longitudinal
meridian.
UTC is based on a 24-hour
clock.
CLOCK SYNCHRONIZATION
 Each clock has a maximum drift rate
 1- dC/dt <= 1+
 Two clocks may drift by 2 t in time t
 To limit drift to  resynchronize after every
2 seconds
CHRISTIAN’S ALGORITHM
 Assuming there is one time server with UTC(Coordinated universal
time):
 Each node in the distributed system periodically polls the time server.
 Time( treply) is estimated as t + (Treply + Treq)/2
 This process is repeated several times and an average is provided.
 Machine Treply then attempts to adjust its time.
 Disadvantages:
 Must attempt to take delay between server Treply andtime
server into account
 Single point of failure if time server fails
CRISTIAN’S ALGORITHM
Synchronize machines to a
time server with a UTC
receiver
Machine P requests time from
server every seconds
 Receives time t from
server, P sets clock to
t+treply where treply is the
time to send reply to P
 Use (treq+treply)/2 as an
estimate of treply
 Improve accuracy by
making a series of
measurements
PROBLEM WITH CRISTIAN’S ALGORITHM
 Time must never run
backward
 If sender‟s clock is
fast, CUTC will be
smaller than the
sender‟s current value
of C
Major Problem Minor Problem
 It takes nonzero time
for the time server‟s
reply
 This delay may be large
and vary with network
load
SOLUTION
Major Problem
 Control the clock
 Suppose that the timer set
to generate 100 intrpt/sec
 Normally each interrupt
add 10 msec to the time
 To slow down add only 9
msec
 To advance add 11 msec to
the time
Minor Problem
 Measure it
 Make a series of
measurements for accuracy
 Discard the measurements
that exceeds the threshold
value
 The message that came
back fastest can be taken to
be the most accurate.
BERKELEY ALGORITHM
 Used in systems without UTC receiver
 Keep clocks synchronized with one another
 One computer is master, other are slaves
 Master periodically polls slaves for their times
 Average times and return differences to slaves
 Communication delays compensated as in Cristian‟s
algo
 Failure of master => election of a new master
BERKELEY ALGORITHM
a)
b)
c)
The time daemon asks all the other machines for their clock values
The machines answer
The time daemon tells everyone how to adjust their clock
30
DECENTRALIZED AVERAGING ALGORITHM
 Each machine on the distributed system has a daemon
without UTC.
 Periodically, at an agreed-upon fixed time, each machine
broadcasts its local time.
 Each machine calculates the correct time by averaging
all results.
TERMINATION DETECTION
 Detecting the end of a distributed computation
 Notation: let sender be predecessor, receiver be successor
 Two types of markers: Done and Continue
 After finishing its part of the snapshot, process Q sends a
Done or a Continue to its predecessor
 Send a Done only when
 All of Q‟s successors send a Done
 Q has not received any message since it check-pointed its local state
and received a marker on all incoming channels
 Else send a Continue
 Computation has terminated if the initiator receives Done
messages from everyone
DISTRIBUTED SYNCHRONIZATION
 Distributed system with multiple processes may
need to share data or access shared data
structures
 Use critical sections with mutual exclusion
 Single process with multiple threads
 Semaphores, locks, monitors
 How do you do this for multiple processes in a
distributed system?
 Processes may be running on different machines
 Solution: lock mechanism for a distributed
environment
 Can be centralized or distributed
CENTRALIZED MUTUAL EXCLUSION
 Assume processes are numbered
 One process is elected coordinator (highest ID
process)
 Every process needs to check with coordinator
before entering the critical section
 To obtain exclusive access: send request, await
reply
 To release: send release message
 Coordinator:
 Receive request: if available and queue empty, send
grant; if not, queue request
 Receive release: remove next request from queue and
send grant
MUTUAL EXCLUSION:
A CENTRALIZED ALGORITHM
a) Process 1 asks the coordinator for permission to enter a
critical region. Permission is granted
b) Process 2 then asks permission to enter the same critical
region. The coordinator does not reply.
c) When process 1 exits the critical region, it tells the
coordinator, when then replies to 2
PROPERTIES
 Simulates centralized lock using blocking calls
 Fair: requests are granted the lock in the order they were
received
 Simple: three messages per use of a critical section
(request, grant, release)
 Shortcomings:
 Single point of failure
 How do you detect a dead coordinator?
 A process can not distinguish between “lock in use” from a dead
coordinator
 No response from coordinator in either case
 Performance bottleneck in large distributed systems
DISTRIBUTED ALGORITHM
 [Ricart and Agrawala]: needs 2(n-1) messages
 Based on event ordering and time stamps
 Process k enters critical section as follows
 Generate new time stamp TSk = TSk+1
 Send request(k,TSk) all other n-1 processes
 Wait until reply(j) received from all other processes
 Enter critical section
 Upon receiving a request message, process j
 Sends reply if no contention
 If already in critical section, does not reply, queue request
 If wants to enter, compare TSj with TSk and send reply if TSk<TSj,
else queue
A DISTRIBUTED ALGORITHM
a)
b)
c)
Two processes want to enter the same critical region at the same
moment.
Process 0 has the lowest timestamp, so it wins.
When process 0 is done, it sends an OK also, so 2 can now enter
the critical region.
PROPERTIES
 Fully decentralized
 N points of failure!
 All processes are involved in all decisions
 Any overloaded process can become a
bottleneck
ELECTION ALGORITHMS
 Many distributed algorithms need one process
to act as coordinator
 Doesn‟t matter which process does the job, just
need to pick one
 Election algorithms: technique to pick a unique
coordinator (aka leader election)
 Examples: take over the role of a failed
process, pick a master in Berkeley clock
synchronization algorithm
 Types of election algorithms: Bully and Ring
algorithms
BULLY ALGORITHM
 Each process has a unique numerical ID
 Processes know the Ids and address of every other
process
 Communication is assumed reliable
 Key Idea: select process with highest ID
 Process initiates election if it just recovered from
failure or if coordinator failed
 3 message types: election, OK, I won
 Several processes can initiate an election
simultaneously
 Need consistent result
 O(n2) messages required with n processes
BULLY ALGORITHM DETAILS
 Any process P can initiate an election
 P sends Election messages to all process with
higher Ids and awaits OK messages
 If no OK messages, P becomes coordinator and
sends I won messages to all process with lower Ids
 If it receives an OK, it drops out and waits for an I
won
 If a process receives an Election msg, it returns an
OK and starts an election
 If a process receives a I won, it treats sender an
coordinator
BULLY ALGORITHM EXAMPLE




The bully election algorithm
Process 4 holds an election
Process 5 and 6 respond, telling 4 to stop
Now 5 and 6 each hold an election
BULLY ALGORITHM EXAMPLE
d)
e)
Process 6 tells 5 to stop
Process 6 wins and tells everyone
RING-BASED ELECTION
 Processes have unique Ids and arranged in a logical ring
 Each process knows its neighbors
 Select process with highest ID
 Begin election if just recovered or coordinator has failed
 Send Election to closest downstream node that is alive
 Sequentially poll each successor until a live node is found
 Each process tags its ID on the message
 Initiator picks node with highest ID and sends a coordinator
message
 Multiple elections can be in progress
 Wastes network bandwidth but does no harm
A RING ALGORITHM
 Election algorithm using a ring.
A TOKEN RING ALGORITHM
a)
b)
An unordered group of processes on a network.
A logical ring constructed in software.
• Use a token to arbitrate access to critical section
• Must wait for token before entering CS
• Pass the token to neighbor once done or if not interested
• Detecting token loss in non-trivial
COMPARISON
 A comparison of three mutual exclusion
algorithms.
Algorithm
Messages per
entry/exit
Delay before entry (in
message times) Problems
Centralized 3 2 Coordinator crash
Distributed 2 ( n – 1 ) 2 ( n – 1 )
Crash of any
process
Token ring 1 to 0 to n – 1
Lost token, process
crash
TRANSACTIONS
Transactions provide higher
level mechanism for atomicity
of processing in distributed
systems
 Have their origins in databases
Banking example: Three
accounts A:$100, B:$200,
C:$300
 Client 1: transfer $4 fromA to
B
 Client 2: transfer $3 from C to
B
Result can be inconsistent
unless certain properties are
Client 1 Client 2
Read A:$100
Write A: $96
Read C: $300
Write C:$297
Read B: $200
Read B: $200
Write B:$203
Write B:$204
Trans..ACID PROPERTIES
Atomic: all or nothing
Consistent: transaction takes
system from one consistent
state to another
Isolated: Immediate effects
are not visible to other
(serializable)
Durable: Changes are
permanent once transaction
completes (commits)
Client 1 Client 2
Read A:$100
Write A: $96
Read B: $200
Write B:$204
Read C: $300
Write C:$297
Read B: $204
Write B:$207
Ad

More Related Content

What's hot (20)

Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
AbDul ThaYyal
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
pinki soni
 
Synchronization
SynchronizationSynchronization
Synchronization
Sara shall
 
Chapter 6 synchronization
Chapter 6 synchronizationChapter 6 synchronization
Chapter 6 synchronization
Alagappa Government Arts College, Karaikudi
 
Distributed System
Distributed SystemDistributed System
Distributed System
Praveen Penumathsa
 
Ds ppt imp.
Ds ppt imp.Ds ppt imp.
Ds ppt imp.
Mayank Jain
 
Clocks
ClocksClocks
Clocks
guesta013ed8
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing time
Deepak John
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
S. Anbu
 
Ds practical file
Ds practical fileDs practical file
Ds practical file
Khushboo Pal
 
Synchronization
SynchronizationSynchronization
Synchronization
Ameena Tijjani
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
Zbigniew Jerzak
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI
 
Time in distributed systmes
Time in distributed systmesTime in distributed systmes
Time in distributed systmes
mohammad amid abbasi
 
Distributed System Management
Distributed System ManagementDistributed System Management
Distributed System Management
Ibrahim Amer
 
Shoaib
ShoaibShoaib
Shoaib
Mohammed Shoaib Khan
 
OSCh17
OSCh17OSCh17
OSCh17
Joe Christensen
 
Shoaib
ShoaibShoaib
Shoaib
Mohammed Shoaib Khan
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
pinki soni
 
Synchronization
SynchronizationSynchronization
Synchronization
Sara shall
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing time
Deepak John
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
S. Anbu
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
Zbigniew Jerzak
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI
 
Distributed System Management
Distributed System ManagementDistributed System Management
Distributed System Management
Ibrahim Amer
 

Similar to 3. syncro. in distributed system (20)

Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
MohdAbdulHaque
 
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.ppt
sirajmohammed35
 
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.pptdokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
Chapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.pptChapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.pptChapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmTime-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
Dhivyaa C.R
 
Chapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.pptChapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.ppt
MeymunaMohammed1
 
Unit V Synchronization of distributed system.pptx
Unit V Synchronization of distributed system.pptxUnit V Synchronization of distributed system.pptx
Unit V Synchronization of distributed system.pptx
OmkarShinde400615
 
Parallel and Distributed Computing Chapter 13
Parallel and Distributed Computing Chapter 13Parallel and Distributed Computing Chapter 13
Parallel and Distributed Computing Chapter 13
AbdullahMunir32
 
Clock synchronization
Clock synchronizationClock synchronization
Clock synchronization
Medicaps University
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
SVijaylakshmi
 
Hu3513551364
Hu3513551364Hu3513551364
Hu3513551364
IJERA Editor
 
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptxDC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
NusrathFarheen1
 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed Systems
Nandakumar P
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
IRJET Journal
 
L12.FA20.ppt
L12.FA20.pptL12.FA20.ppt
L12.FA20.ppt
MAliHaider4
 
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
Subhajit Sahu
 
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.ppt
sirajmohammed35
 
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.pptdokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
Chapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.pptChapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.pptChapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmTime-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
Dhivyaa C.R
 
Chapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.pptChapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.ppt
MeymunaMohammed1
 
Unit V Synchronization of distributed system.pptx
Unit V Synchronization of distributed system.pptxUnit V Synchronization of distributed system.pptx
Unit V Synchronization of distributed system.pptx
OmkarShinde400615
 
Parallel and Distributed Computing Chapter 13
Parallel and Distributed Computing Chapter 13Parallel and Distributed Computing Chapter 13
Parallel and Distributed Computing Chapter 13
AbdullahMunir32
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
SVijaylakshmi
 
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptxDC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
DC UNIT 1 cs 3551 DISTRIBUTED COMPUTING.pptx
NusrathFarheen1
 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed Systems
Nandakumar P
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
IRJET Journal
 
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
About TrueTime, Spanner, Clock synchronization, CAP theorem, Two-phase lockin...
Subhajit Sahu
 
Ad

Recently uploaded (20)

Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Ad

3. syncro. in distributed system

  • 2. CANONICAL PROBLEMS IN DISTRIBUTED SYSTEMS  Time ordering and clock synchronization  Election  Mutual exclusion  Distributed transactions
  • 3. THE IMPORTANCE OF SYNCHRONIZATION  Because various components of a distributed system must cooperate and exchange information, synchronization is a necessity.  Constraints, both implicit and explicit, are therefore enforced to ensure synchronization of components.
  • 4. CLOCK SYNCHRONIZATION  As in non-distributed systems, the knowledge of “when events occur” is necessary.  However, clock synchronization is often more difficult in distributed systems because there is no ideal time source.  Distributed algorithms must overcome:  Scattering of information  Local, rather than global, decision-making.
  • 5. Conti....  Time is unambiguous in centralized systems  Distributed systems: each node has own system clock.  Crystal-based clocks are less accurate (1 part in million)  Problem: An event that occurred after another may be assigned an earlier time
  • 6. LACK OF GLOBAL TIME IN DS (Clock syn.)  It is impossible to guarantee that physical clocks run at the same frequency  Lack of global time, can cause problem.  Example: UNIX make  Edit output.c at a client  output.o is at a server (compile at server)  Client machine clock can be lagging behind the server machine clock
  • 7. LACK OF GLOBAL TIME – EXAMPLE When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.
  • 8. LOGICAL CLOCKS  Often, it is not necessary for a computer to know the exact time, only relative time. This is known as “logical time”.  Logical time is not based on timing but on the ordering of events.  Logical clocks can only advance forward, not in reverse.  Non-interacting processes cannot share a logical clock.  Computers generally obtain logical time using interrupts to update a software clock. The more interrupts (the more frequently time is updated), the higher the overhead.
  • 9. LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION ALGORITHM  The most common logical clock synchronization algorithm for distributed systems is Lamport‟s Algorithm. It is used in situations where ordering is important but global time is not required.  Based on the “happens-before” relation:  Event A “happens-before” Event B (A→B) when all processes involved in a distributed system agree that event A occurred first, and B subsequently occurred.  This DOES NOT mean that Event A actually occurred before Event B in absolute clock time.
  • 10. LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION ALGORITHM  A distributed system can use the “happens-before” relation when:  Events A and B are observed by the same process, or by multiple processes with the same global clock  Event A acknowledges sending a message and Event B acknowledges receiving it, since a message cannot be received before it is sent  If two events do not communicate via messages, they are considered concurrent – because order cannot be determined and it does not matter. Concurrent events can be ignored.
  • 11. LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION ALGORITHM (CONT.)  In the previous examples, Clock C(a) < C(b)  If they are concurrent, C(a) = C(b)  Concurrent events can only occur on the same system, because every message transfer between two systems takes at least one clock tick.  In Lamport‟s Algorithm, logical clock values for events may be changed, but always by moving the clock forward. Time values can never be decreased.
  • 12. LAMPORT’S LOGICAL CLOCK SYNCHRONIZATION ALGORITHM (CONT.)  Lamport‟s Algorithm can thus be used in distributed systems to ensure synchronization:  A logical clock is implemented in each node in the system.  Each node can determine the order in which events have occurred in that system’s own point of view.  The logical clock of one node does not need to have any relation to real time or to any other node in the system.
  • 13. PROCESS EACH WITH ITS OWN CLOCK •At time 6 , Process 0 sends message A to Process 1 •It arrives to Process 1 at 16( It took 10 ticks to make journey •Message B from 1 to 2 takes 16 ticks •Message C from 2 to 1 leaves at 60 and arrives at 56 -Not Possible •Message D from 1 to 0 leaves at 64 and arrives at 54 -Not Possible
  • 14. LAMPORT’S ALGORITHM CORRECTS THE CLOCKS  Use „happened-before‟ relation  Each message carries the sending time (as per sender‟s clock)  When arrives, receiver fast forwards its clock to be one more than the sending time. (between every two events, the clock must tick at least once)
  • 15. PHYSICAL CLOCKS  The time difference between two computers is known as drift. Clock drift over time is known as skew. Computer clock manufacturers specify a maximum skew rate in their products.  Computer clocks are among the least accurate modern timepieces.  Inside every computer is a chip surrounding a quartz crystal oscillator to record time. These crystals cost 25 seconds to produce.  Average loss of accuracy: 0.86 seconds per day  This skew is unacceptable for distributed systems. Several methods are now in use to attempt the synchronization of physical clocks in distributed systems:
  • 16. PHYSICAL CLOCKS  17th Century: time has been measured astronomically  Solar Day: interval between two consecutive transit of sun  Solar Second: 1/86400th of solar day
  • 17. PHYSICAL CLOCKS  1948: Atomic Clocks are invented  Accurate clocks are atomic oscillators (one part in 1013)  BIH decide TAI(International Atomic Time)  TAI seconds is now about 3 msec less than solar day  BIH solves the problem by introducing leap seconds Whenever discrepancy between TAI and solar time grow to 800 msec  This time is called Universal Coordinated Time(UTC)  When BIH announces leap second, the power companies raise their frequency to 61 & 51 Hz for 60 & 50 sec, to advance all the clocks in their distribution area.
  • 18. PHYSICAL CLOCKS - UTC Coordinated Universal Time (UTC) is the international time standard. UTC is the current term for what was commonly referred to as Greenwich Mean Time (GMT). Zero hours UTC is midnight in Greenwich, England, which lies on the zero longitudinal meridian. UTC is based on a 24-hour clock.
  • 19. CLOCK SYNCHRONIZATION  Each clock has a maximum drift rate  1- dC/dt <= 1+  Two clocks may drift by 2 t in time t  To limit drift to  resynchronize after every 2 seconds
  • 20. CHRISTIAN’S ALGORITHM  Assuming there is one time server with UTC(Coordinated universal time):  Each node in the distributed system periodically polls the time server.  Time( treply) is estimated as t + (Treply + Treq)/2  This process is repeated several times and an average is provided.  Machine Treply then attempts to adjust its time.  Disadvantages:  Must attempt to take delay between server Treply andtime server into account  Single point of failure if time server fails
  • 21. CRISTIAN’S ALGORITHM Synchronize machines to a time server with a UTC receiver Machine P requests time from server every seconds  Receives time t from server, P sets clock to t+treply where treply is the time to send reply to P  Use (treq+treply)/2 as an estimate of treply  Improve accuracy by making a series of measurements
  • 22. PROBLEM WITH CRISTIAN’S ALGORITHM  Time must never run backward  If sender‟s clock is fast, CUTC will be smaller than the sender‟s current value of C Major Problem Minor Problem  It takes nonzero time for the time server‟s reply  This delay may be large and vary with network load
  • 23. SOLUTION Major Problem  Control the clock  Suppose that the timer set to generate 100 intrpt/sec  Normally each interrupt add 10 msec to the time  To slow down add only 9 msec  To advance add 11 msec to the time Minor Problem  Measure it  Make a series of measurements for accuracy  Discard the measurements that exceeds the threshold value  The message that came back fastest can be taken to be the most accurate.
  • 24. BERKELEY ALGORITHM  Used in systems without UTC receiver  Keep clocks synchronized with one another  One computer is master, other are slaves  Master periodically polls slaves for their times  Average times and return differences to slaves  Communication delays compensated as in Cristian‟s algo  Failure of master => election of a new master
  • 25. BERKELEY ALGORITHM a) b) c) The time daemon asks all the other machines for their clock values The machines answer The time daemon tells everyone how to adjust their clock
  • 26. 30 DECENTRALIZED AVERAGING ALGORITHM  Each machine on the distributed system has a daemon without UTC.  Periodically, at an agreed-upon fixed time, each machine broadcasts its local time.  Each machine calculates the correct time by averaging all results.
  • 27. TERMINATION DETECTION  Detecting the end of a distributed computation  Notation: let sender be predecessor, receiver be successor  Two types of markers: Done and Continue  After finishing its part of the snapshot, process Q sends a Done or a Continue to its predecessor  Send a Done only when  All of Q‟s successors send a Done  Q has not received any message since it check-pointed its local state and received a marker on all incoming channels  Else send a Continue  Computation has terminated if the initiator receives Done messages from everyone
  • 28. DISTRIBUTED SYNCHRONIZATION  Distributed system with multiple processes may need to share data or access shared data structures  Use critical sections with mutual exclusion  Single process with multiple threads  Semaphores, locks, monitors  How do you do this for multiple processes in a distributed system?  Processes may be running on different machines  Solution: lock mechanism for a distributed environment  Can be centralized or distributed
  • 29. CENTRALIZED MUTUAL EXCLUSION  Assume processes are numbered  One process is elected coordinator (highest ID process)  Every process needs to check with coordinator before entering the critical section  To obtain exclusive access: send request, await reply  To release: send release message  Coordinator:  Receive request: if available and queue empty, send grant; if not, queue request  Receive release: remove next request from queue and send grant
  • 30. MUTUAL EXCLUSION: A CENTRALIZED ALGORITHM a) Process 1 asks the coordinator for permission to enter a critical region. Permission is granted b) Process 2 then asks permission to enter the same critical region. The coordinator does not reply. c) When process 1 exits the critical region, it tells the coordinator, when then replies to 2
  • 31. PROPERTIES  Simulates centralized lock using blocking calls  Fair: requests are granted the lock in the order they were received  Simple: three messages per use of a critical section (request, grant, release)  Shortcomings:  Single point of failure  How do you detect a dead coordinator?  A process can not distinguish between “lock in use” from a dead coordinator  No response from coordinator in either case  Performance bottleneck in large distributed systems
  • 32. DISTRIBUTED ALGORITHM  [Ricart and Agrawala]: needs 2(n-1) messages  Based on event ordering and time stamps  Process k enters critical section as follows  Generate new time stamp TSk = TSk+1  Send request(k,TSk) all other n-1 processes  Wait until reply(j) received from all other processes  Enter critical section  Upon receiving a request message, process j  Sends reply if no contention  If already in critical section, does not reply, queue request  If wants to enter, compare TSj with TSk and send reply if TSk<TSj, else queue
  • 33. A DISTRIBUTED ALGORITHM a) b) c) Two processes want to enter the same critical region at the same moment. Process 0 has the lowest timestamp, so it wins. When process 0 is done, it sends an OK also, so 2 can now enter the critical region.
  • 34. PROPERTIES  Fully decentralized  N points of failure!  All processes are involved in all decisions  Any overloaded process can become a bottleneck
  • 35. ELECTION ALGORITHMS  Many distributed algorithms need one process to act as coordinator  Doesn‟t matter which process does the job, just need to pick one  Election algorithms: technique to pick a unique coordinator (aka leader election)  Examples: take over the role of a failed process, pick a master in Berkeley clock synchronization algorithm  Types of election algorithms: Bully and Ring algorithms
  • 36. BULLY ALGORITHM  Each process has a unique numerical ID  Processes know the Ids and address of every other process  Communication is assumed reliable  Key Idea: select process with highest ID  Process initiates election if it just recovered from failure or if coordinator failed  3 message types: election, OK, I won  Several processes can initiate an election simultaneously  Need consistent result  O(n2) messages required with n processes
  • 37. BULLY ALGORITHM DETAILS  Any process P can initiate an election  P sends Election messages to all process with higher Ids and awaits OK messages  If no OK messages, P becomes coordinator and sends I won messages to all process with lower Ids  If it receives an OK, it drops out and waits for an I won  If a process receives an Election msg, it returns an OK and starts an election  If a process receives a I won, it treats sender an coordinator
  • 38. BULLY ALGORITHM EXAMPLE     The bully election algorithm Process 4 holds an election Process 5 and 6 respond, telling 4 to stop Now 5 and 6 each hold an election
  • 39. BULLY ALGORITHM EXAMPLE d) e) Process 6 tells 5 to stop Process 6 wins and tells everyone
  • 40. RING-BASED ELECTION  Processes have unique Ids and arranged in a logical ring  Each process knows its neighbors  Select process with highest ID  Begin election if just recovered or coordinator has failed  Send Election to closest downstream node that is alive  Sequentially poll each successor until a live node is found  Each process tags its ID on the message  Initiator picks node with highest ID and sends a coordinator message  Multiple elections can be in progress  Wastes network bandwidth but does no harm
  • 41. A RING ALGORITHM  Election algorithm using a ring.
  • 42. A TOKEN RING ALGORITHM a) b) An unordered group of processes on a network. A logical ring constructed in software. • Use a token to arbitrate access to critical section • Must wait for token before entering CS • Pass the token to neighbor once done or if not interested • Detecting token loss in non-trivial
  • 43. COMPARISON  A comparison of three mutual exclusion algorithms. Algorithm Messages per entry/exit Delay before entry (in message times) Problems Centralized 3 2 Coordinator crash Distributed 2 ( n – 1 ) 2 ( n – 1 ) Crash of any process Token ring 1 to 0 to n – 1 Lost token, process crash
  • 44. TRANSACTIONS Transactions provide higher level mechanism for atomicity of processing in distributed systems  Have their origins in databases Banking example: Three accounts A:$100, B:$200, C:$300  Client 1: transfer $4 fromA to B  Client 2: transfer $3 from C to B Result can be inconsistent unless certain properties are Client 1 Client 2 Read A:$100 Write A: $96 Read C: $300 Write C:$297 Read B: $200 Read B: $200 Write B:$203 Write B:$204
  • 45. Trans..ACID PROPERTIES Atomic: all or nothing Consistent: transaction takes system from one consistent state to another Isolated: Immediate effects are not visible to other (serializable) Durable: Changes are permanent once transaction completes (commits) Client 1 Client 2 Read A:$100 Write A: $96 Read B: $200 Write B:$204 Read C: $300 Write C:$297 Read B: $204 Write B:$207
  翻译: