SlideShare a Scribd company logo
1 of 42
Instructor: Dr. Nayef Saleh
Student: Sara Shall
*
*
• Logical Clocks
• Physical Clocks
• Clock Synchronization Algorithms
• Use Of Synchronized Clocks
• Mutual Exclusion
• Election Algorithms
• Atomic Transactions
• Deadlocks in Distributed Operating System
Clock Synchronization
*
• Logical clocks is concerned about “what event happened before?”
• The expression a b is read “ a happens before b”.
• The happens-before relation can be observed in two situations:
- If a and b are in the same process, and a occurs before b.
- If a is the events of a message being sent by one process, and b is
The event of the message being received by another process.
- If a and b are two events within the same process and a occurs
before b then C(a) < C(b).
*
*
• We have additional requirements: no two events ever occur at
exactly the same time.
• If events happened in processes 1 and 2, both with time 40, the
former becomes 40.1 and the latter becomes 40.2.
• Then, using this method we can assign time in distributed
operating system:
a) If a happens before b in the same process, C(a) < C(b).
b) If a and b represent the sending and receiving of a message, C(a)
< C(b).
c) For all events a and b, C(b) != C(b).
*
• In some systems, the actual clock time is important.
• Radio receivers for WWV, GEOS, and the other UTC sources are
available and can provide accurate clock time.
• They require accurate knowledge of the relevant position of the
sender and receiver.
• Coordinated Universal Time(UTC): It is based on an atomic clock
to which adjustments of a second (called a leap second) are
sometimes made to allow for variations in the solar cycle.
*
• If one machine has a WWV receiver, the goal becomes keeping all
the other machines synchronize to it.
• If no machines have WWV receivers, each machine keeps track of
its own time.
• It is impossible to guarantee that
the crystals in different computer all
run at exactly the same frequency. So,
A particular machine can get a value in
the range 215,998 and 216,002 ticks
Per hour.
*
• Christian's Algorithm:
• This algorithm is suited to systems I which one machine has a
WWV receiver and the goal is to have all other machines stay
synchronized to it.
• The Berkeley Algorithm:
• This method is suitable for a system in which no machine has a
WWV receiver.
• The time her is coordinated by Time daemon.
*
*
• At-Most-Once Message Delivery:
1. Every message carry a connection identifier and timestamp.
2. For each connection the server record in a table the most recent
timestamp it has seen.
3. If any incoming message for a connection is lower than the
timestamp stored for that connection the message is rejected as
a duplicate.
4. To remove old timestamps, each server maintains a global
variable:
G= CurrentTime – MaxLifetime – MaxClockSkew
• G is a summary of the message numbers of all old messages.
• ∆𝑇 is the current time is written to the disk.
*
• Clock-Based Cache Consistency:
• Caching introduces potential inconsistency if two clients modify
the same file at the same time.
• The usual solution is to distinguish between caching a file for
reading and caching a file for writing.
• Another idea is when a client wants a file, it is given a lease on it
with specified period of time.
• This lease can be renewed when it expired.
• If one or more clients have a file cached for reading and then
another client wants to write on the file, the server has to ask
the readers to prematurely terminate their leases.
• If one or more of them has crashed, the server can just wait until
the dead server's lease times out.
*
• A Centralized Algorithm:
*
• A Distributed Algorithm:
*
• A Token Ring Algorithm:
*
• A Comparison Of The Three Algorithms:
*
• The task of election algorithms is to elect which process will be
the coordinator.
• The goal of an election algorithm is to ensure that when an
election starts, it concludes that all processes agreeing on who
the new coordinator is to be.
*
• The Bully Algorithm:
• When a process notices that the coordinator in no longer
responding to requests, it initiates an election as follows:
1. P sends an ELECTION message to all processes with higher
numbers.
2. If no one responds, P wins the election and becomes coordinator.
3. If one of the higher-ups answers, it takes over. P’s job is done.
*if a process that was previously down comes back up, it holds an
election. If it happens to be the highest-numbered process currently
running, it will win the election and take over the coordinator’s job.
*
• The Bully Algorithm:
*
• A Ring Algorithm:
• It is base on a ring but without a token.
• The processes are physically or logically ordered and each process
knows who its successor.
• When any process notices that the coordinator is not functioning, it
build an ELECTION message containing its own process number and
sends it to its successor.
• This message will circulate over the ring and pass process that is not
responsive.
• At each step the sender adds it own process number to the list in the
message.
• When the message arrive to the process that started it, the process
will recognize its own number. At this point the message type is
changed to COORDINATOR message and circulated again in the ring.
*
• A Ring Algorithm:
*
• Elections in Wireless Environments:
• To elect a leader, any node in the network, called the source, can
initiate an election by sending an ELECTION message to its
immediate neighbors .
• P:287
*
• Elections in Wireless Environments:
*
• Elections in Large-Scale Systems:
• In large scale system the are several nodes should be selected.
Such as in the case of superpeers in peer-to-peer networks.
• Requirements for superpeer selection:
1. Normal nodes should have low-latency access to superpeers.
2. Super peers should be evenly distributed across the overlay
network.
3. There should be predefined portion of superpeers relative to the
total number of nodes in the overlay network.
4. Each superpeer should not need to serve more than a fixed
number of normal nodes.
*
• Elections in Large-Scale Systems:
 Unstructured Systems:
• A total of N tokens are spread across N randomly-chosen nodes.
• Each token represents a repelling force by which another token is
inclined to move away.
*
• Atomic transactions allow the programmer to concentrate on the
algorithms and how processes work together in parallel.
• The Transaction Model:
• Stable Storage:
• RAM memory is wiped out when the power fails or machine
crashes.
• Disk storage survives CPU failures but can be lost in disk head
crashes.
• Stable Storage is designed to survives anything except major
calamities. It can be implemented with a pair of ordinary
disks.
*
• Stable Storage
*
• Transaction Primitives:
1. BEGIN_TRANSACTION: mark the start of a transaction.
2. END_TRANSACTION: Terminate the transaction and try to
commit.
3. ABORT_TRANSACTION: Kill the transaction; restore the old
values.
4. READ: Read data from file(or other object).
5. WRITE: Write data to file (or other object).
• The exact list of primitives depends on what kinds of objects
used in transaction.
• In an email server there might be primitives to send, receive
and forward mail.
*
• Properties of Transactions:
Transactions have four essential properties:
 Atomicity:
All or nothing- transaction either completes successfully, or
has no effect at all
 Isolation
Each transaction must be performed without interference
from other transactions
 Consistency
a transaction takes the system from one consistent state to
another consistent state
 Durability
After a transaction has completed successfully, all its effects
are saved in permanent storage
*
• Nested Transactions:
Transactions that may contain sub transactions, often called nested
transaction.
*
• Implementation:
Private Workspace:
when a process starts a transaction, it is given a private workspace
containing all the files to which has access.
Until the transaction either commits or aborts, all of its reads and
writes go to the private workspace.
*
• Implementation:
Writeahead Log:
With this method, files are modified in place, but before any block
is changed, a record is written to the writeahead log on stable
storage telling which transaction is making the change, which file
and block is being changed, and what the old and new values are.
*
• Implementation:
Two-Phase Commit Protocol:
*
Concurrency Control:
When multiple transactions are executing simultaneously in
different processes we need concurrency control algorithm to
keep the out of each other’s way.
Locking
• If a process need to read from a file it locks this file to make sure
that the file will not change, but other processes can also read
from the same file.
• In contrast, when a file is locked for writing, no other locks of
any kind are permitted.
*
Locking:
• Tow-phase Locking: The process first acquires all the locks it
needs during the growing phase, then release them during the
shrink phase.
*
Locking:
• Strict Tow-phase Locking: The process first acquires all the locks
it needs during the growing phase, then release them when
transaction has finished running and has either committed or
aborted.
*
Optimistic Concurrency Control:
The idea behind this technique is just go ahead and do whatever you
want to, without paying attention to what anybody else is doing. If
there is a problem, worry about it later.
• Transactions are allowed to proceed until the client completes its
task and issues a closeTransaction request.
• When a conflict arises, some transaction will be aborted and will
need to be restarted by the client.
• Works well with private workspaces
• Advantage: – Deadlock free – Maximum parallelism.
• Disadvantage: – Rerun transaction if aborts – Probability of
conflict rises substantially at high loads
• Not used widely
*
Timestamps:
• It is to assign each transaction a timestamp at the moment it
does BEGIN_TRANSACTION.
• Every file in the system has a read timestamp and a write
timestamp associated with it.
*
Distributed Deadlock Detection:
• Centralized Deadlock Detection:
The central coordinator maintains the resource graph for the entire
system. When the coordinator detects a cycle, it kills off one
process to break the deadlock.
• False deadlock:
*
Distributed Deadlock Detection:
• Distributed Deadlock Detection:
In this algorithm, processes are allowed to request multiple
resources at once, instead of one at a time.
*
Distributed Deadlock Detection:
• It consists of designing the system to that deadlocks are
structurally impossible.
• In a distributed operating system there is a method that is based
on assigning each transaction a global timestamp at the moment
it starts.
*

More Related Content

What's hot

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
Adoptive retransmission in TCP
Adoptive retransmission in TCPAdoptive retransmission in TCP
Adoptive retransmission in TCPselvakumar_b1985
 
Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed SystemsRitu Ranjan Shrivastwa
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreadingFraboni Ec
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems SHATHAN
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
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
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsAya Mahmoud
 
Schedule Based MAC Protocol
Schedule Based MAC ProtocolSchedule Based MAC Protocol
Schedule Based MAC ProtocolDarwin Nesakumar
 
OPEN SHORTEST PATH FIRST (OSPF)
OPEN SHORTEST PATH FIRST (OSPF)OPEN SHORTEST PATH FIRST (OSPF)
OPEN SHORTEST PATH FIRST (OSPF)Ann Joseph
 
Routing in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksRouting in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksSayed Chhattan Shah
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Unit 6 interprocessor arbitration
Unit 6 interprocessor arbitrationUnit 6 interprocessor arbitration
Unit 6 interprocessor arbitrationDipesh Vaya
 

What's hot (20)

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
Adoptive retransmission in TCP
Adoptive retransmission in TCPAdoptive retransmission in TCP
Adoptive retransmission in TCP
 
Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed Systems
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 
Coda file system
Coda file systemCoda file system
Coda file system
 
Distributed shared memory ch 5
Distributed shared memory ch 5Distributed shared memory ch 5
Distributed shared memory ch 5
 
Agreement protocol
Agreement protocolAgreement protocol
Agreement protocol
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
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
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Schedule Based MAC Protocol
Schedule Based MAC ProtocolSchedule Based MAC Protocol
Schedule Based MAC Protocol
 
OPEN SHORTEST PATH FIRST (OSPF)
OPEN SHORTEST PATH FIRST (OSPF)OPEN SHORTEST PATH FIRST (OSPF)
OPEN SHORTEST PATH FIRST (OSPF)
 
Routing in Mobile Ad hoc Networks
Routing in Mobile Ad hoc NetworksRouting in Mobile Ad hoc Networks
Routing in Mobile Ad hoc Networks
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - Channelization
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Chapter 6 synchronization
Chapter 6 synchronizationChapter 6 synchronization
Chapter 6 synchronization
 
Unit 6 interprocessor arbitration
Unit 6 interprocessor arbitrationUnit 6 interprocessor arbitration
Unit 6 interprocessor arbitration
 

Similar to Synchronization

Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxMArshad35
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisZak Cole
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptxSamPrem3
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...morganjohn3
 
Synchronization in Distributed Systems.pptx
Synchronization in Distributed Systems.pptxSynchronization in Distributed Systems.pptx
Synchronization in Distributed Systems.pptxRichardMathengeSPASP
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfAmanuelmergia
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfHarika Pudugosula
 
chapter4-processes nd processors in DS.ppt
chapter4-processes nd processors in DS.pptchapter4-processes nd processors in DS.ppt
chapter4-processes nd processors in DS.pptaakarshsiwani1
 
DDB_lec_05_Concurrency_Control.pdf
DDB_lec_05_Concurrency_Control.pdfDDB_lec_05_Concurrency_Control.pdf
DDB_lec_05_Concurrency_Control.pdfAhmedImmamImmam
 
Architecting for the cloud elasticity security
Architecting for the cloud elasticity securityArchitecting for the cloud elasticity security
Architecting for the cloud elasticity securityLen Bass
 

Similar to Synchronization (20)

Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & Analysis
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptx
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
 
Platform Technology (2).pdf
Platform Technology (2).pdfPlatform Technology (2).pdf
Platform Technology (2).pdf
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Synchronization in Distributed Systems.pptx
Synchronization in Distributed Systems.pptxSynchronization in Distributed Systems.pptx
Synchronization in Distributed Systems.pptx
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Chapter00000000
Chapter00000000Chapter00000000
Chapter00000000
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdf
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdf
 
chapter4-processes nd processors in DS.ppt
chapter4-processes nd processors in DS.pptchapter4-processes nd processors in DS.ppt
chapter4-processes nd processors in DS.ppt
 
DDB_lec_05_Concurrency_Control.pdf
DDB_lec_05_Concurrency_Control.pdfDDB_lec_05_Concurrency_Control.pdf
DDB_lec_05_Concurrency_Control.pdf
 
Architecting for the cloud elasticity security
Architecting for the cloud elasticity securityArchitecting for the cloud elasticity security
Architecting for the cloud elasticity security
 
vp.pdf
vp.pdfvp.pdf
vp.pdf
 
Unit 5 dbms
Unit 5 dbmsUnit 5 dbms
Unit 5 dbms
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

Synchronization

  • 1. Instructor: Dr. Nayef Saleh Student: Sara Shall *
  • 2. * • Logical Clocks • Physical Clocks • Clock Synchronization Algorithms • Use Of Synchronized Clocks • Mutual Exclusion • Election Algorithms • Atomic Transactions • Deadlocks in Distributed Operating System
  • 4. * • Logical clocks is concerned about “what event happened before?” • The expression a b is read “ a happens before b”. • The happens-before relation can be observed in two situations: - If a and b are in the same process, and a occurs before b. - If a is the events of a message being sent by one process, and b is The event of the message being received by another process. - If a and b are two events within the same process and a occurs before b then C(a) < C(b).
  • 5. *
  • 6. * • We have additional requirements: no two events ever occur at exactly the same time. • If events happened in processes 1 and 2, both with time 40, the former becomes 40.1 and the latter becomes 40.2. • Then, using this method we can assign time in distributed operating system: a) If a happens before b in the same process, C(a) < C(b). b) If a and b represent the sending and receiving of a message, C(a) < C(b). c) For all events a and b, C(b) != C(b).
  • 7. * • In some systems, the actual clock time is important. • Radio receivers for WWV, GEOS, and the other UTC sources are available and can provide accurate clock time. • They require accurate knowledge of the relevant position of the sender and receiver. • Coordinated Universal Time(UTC): It is based on an atomic clock to which adjustments of a second (called a leap second) are sometimes made to allow for variations in the solar cycle.
  • 8. * • If one machine has a WWV receiver, the goal becomes keeping all the other machines synchronize to it. • If no machines have WWV receivers, each machine keeps track of its own time. • It is impossible to guarantee that the crystals in different computer all run at exactly the same frequency. So, A particular machine can get a value in the range 215,998 and 216,002 ticks Per hour.
  • 9. * • Christian's Algorithm: • This algorithm is suited to systems I which one machine has a WWV receiver and the goal is to have all other machines stay synchronized to it.
  • 10. • The Berkeley Algorithm: • This method is suitable for a system in which no machine has a WWV receiver. • The time her is coordinated by Time daemon. *
  • 11. * • At-Most-Once Message Delivery: 1. Every message carry a connection identifier and timestamp. 2. For each connection the server record in a table the most recent timestamp it has seen. 3. If any incoming message for a connection is lower than the timestamp stored for that connection the message is rejected as a duplicate. 4. To remove old timestamps, each server maintains a global variable: G= CurrentTime – MaxLifetime – MaxClockSkew • G is a summary of the message numbers of all old messages. • ∆𝑇 is the current time is written to the disk.
  • 12. * • Clock-Based Cache Consistency: • Caching introduces potential inconsistency if two clients modify the same file at the same time. • The usual solution is to distinguish between caching a file for reading and caching a file for writing. • Another idea is when a client wants a file, it is given a lease on it with specified period of time. • This lease can be renewed when it expired. • If one or more clients have a file cached for reading and then another client wants to write on the file, the server has to ask the readers to prematurely terminate their leases. • If one or more of them has crashed, the server can just wait until the dead server's lease times out.
  • 13. * • A Centralized Algorithm:
  • 14. * • A Distributed Algorithm:
  • 15. * • A Token Ring Algorithm:
  • 16. * • A Comparison Of The Three Algorithms:
  • 17. * • The task of election algorithms is to elect which process will be the coordinator. • The goal of an election algorithm is to ensure that when an election starts, it concludes that all processes agreeing on who the new coordinator is to be.
  • 18. * • The Bully Algorithm: • When a process notices that the coordinator in no longer responding to requests, it initiates an election as follows: 1. P sends an ELECTION message to all processes with higher numbers. 2. If no one responds, P wins the election and becomes coordinator. 3. If one of the higher-ups answers, it takes over. P’s job is done. *if a process that was previously down comes back up, it holds an election. If it happens to be the highest-numbered process currently running, it will win the election and take over the coordinator’s job.
  • 19. * • The Bully Algorithm:
  • 20. * • A Ring Algorithm: • It is base on a ring but without a token. • The processes are physically or logically ordered and each process knows who its successor. • When any process notices that the coordinator is not functioning, it build an ELECTION message containing its own process number and sends it to its successor. • This message will circulate over the ring and pass process that is not responsive. • At each step the sender adds it own process number to the list in the message. • When the message arrive to the process that started it, the process will recognize its own number. At this point the message type is changed to COORDINATOR message and circulated again in the ring.
  • 21. * • A Ring Algorithm:
  • 22. * • Elections in Wireless Environments: • To elect a leader, any node in the network, called the source, can initiate an election by sending an ELECTION message to its immediate neighbors . • P:287
  • 23. * • Elections in Wireless Environments:
  • 24. * • Elections in Large-Scale Systems: • In large scale system the are several nodes should be selected. Such as in the case of superpeers in peer-to-peer networks. • Requirements for superpeer selection: 1. Normal nodes should have low-latency access to superpeers. 2. Super peers should be evenly distributed across the overlay network. 3. There should be predefined portion of superpeers relative to the total number of nodes in the overlay network. 4. Each superpeer should not need to serve more than a fixed number of normal nodes.
  • 25. * • Elections in Large-Scale Systems:  Unstructured Systems: • A total of N tokens are spread across N randomly-chosen nodes. • Each token represents a repelling force by which another token is inclined to move away.
  • 26. * • Atomic transactions allow the programmer to concentrate on the algorithms and how processes work together in parallel. • The Transaction Model: • Stable Storage: • RAM memory is wiped out when the power fails or machine crashes. • Disk storage survives CPU failures but can be lost in disk head crashes. • Stable Storage is designed to survives anything except major calamities. It can be implemented with a pair of ordinary disks.
  • 28. * • Transaction Primitives: 1. BEGIN_TRANSACTION: mark the start of a transaction. 2. END_TRANSACTION: Terminate the transaction and try to commit. 3. ABORT_TRANSACTION: Kill the transaction; restore the old values. 4. READ: Read data from file(or other object). 5. WRITE: Write data to file (or other object). • The exact list of primitives depends on what kinds of objects used in transaction. • In an email server there might be primitives to send, receive and forward mail.
  • 29. * • Properties of Transactions: Transactions have four essential properties:  Atomicity: All or nothing- transaction either completes successfully, or has no effect at all  Isolation Each transaction must be performed without interference from other transactions  Consistency a transaction takes the system from one consistent state to another consistent state  Durability After a transaction has completed successfully, all its effects are saved in permanent storage
  • 30. * • Nested Transactions: Transactions that may contain sub transactions, often called nested transaction.
  • 31. * • Implementation: Private Workspace: when a process starts a transaction, it is given a private workspace containing all the files to which has access. Until the transaction either commits or aborts, all of its reads and writes go to the private workspace.
  • 32. * • Implementation: Writeahead Log: With this method, files are modified in place, but before any block is changed, a record is written to the writeahead log on stable storage telling which transaction is making the change, which file and block is being changed, and what the old and new values are.
  • 34. * Concurrency Control: When multiple transactions are executing simultaneously in different processes we need concurrency control algorithm to keep the out of each other’s way. Locking • If a process need to read from a file it locks this file to make sure that the file will not change, but other processes can also read from the same file. • In contrast, when a file is locked for writing, no other locks of any kind are permitted.
  • 35. * Locking: • Tow-phase Locking: The process first acquires all the locks it needs during the growing phase, then release them during the shrink phase.
  • 36. * Locking: • Strict Tow-phase Locking: The process first acquires all the locks it needs during the growing phase, then release them when transaction has finished running and has either committed or aborted.
  • 37. * Optimistic Concurrency Control: The idea behind this technique is just go ahead and do whatever you want to, without paying attention to what anybody else is doing. If there is a problem, worry about it later. • Transactions are allowed to proceed until the client completes its task and issues a closeTransaction request. • When a conflict arises, some transaction will be aborted and will need to be restarted by the client. • Works well with private workspaces • Advantage: – Deadlock free – Maximum parallelism. • Disadvantage: – Rerun transaction if aborts – Probability of conflict rises substantially at high loads • Not used widely
  • 38. * Timestamps: • It is to assign each transaction a timestamp at the moment it does BEGIN_TRANSACTION. • Every file in the system has a read timestamp and a write timestamp associated with it.
  • 39. * Distributed Deadlock Detection: • Centralized Deadlock Detection: The central coordinator maintains the resource graph for the entire system. When the coordinator detects a cycle, it kills off one process to break the deadlock. • False deadlock:
  • 40. * Distributed Deadlock Detection: • Distributed Deadlock Detection: In this algorithm, processes are allowed to request multiple resources at once, instead of one at a time.
  • 41. * Distributed Deadlock Detection: • It consists of designing the system to that deadlocks are structurally impossible. • In a distributed operating system there is a method that is based on assigning each transaction a global timestamp at the moment it starts.
  • 42. *

Editor's Notes

  1. With a single computer and a single clock it does not matter much if this clock is off by a small amount since all processes on the machine use the same clock.
  2. 1-the three processes depicted in Fig. 3-2(a). The processes run on different machines, each with its own clock, running at its own speed. 2-At time 6, process 0 sends message A to process 1. 3-process 0 carry it time(6) with it and process 1 will know that it tacks 10 ticks to arrive. 4- but if we look at c it leaves at 60 and arrive at 56. 5-Lamport's solution follows directly from the happened-before relation. 6- then each msg carry the senders time and the receiver look for its time if it is less than the senders clock the it will take the senders time and add 1 to it
  3. 1- TAI: International Atomic Time is just the mean number of ticks of the cesium 133 clock UTC it gives rise to a time system based on constant TAI seconds but which stays in phase with the apparent motion of the sun. What Is WWV? WWV is the call sign of a US government radio station run by the National Institute of Standards and Technology in Fort Collins, Colorado. WWV transmits frequency reference standards and time code information. The transmitted time code is referenced to a Cesium clock with a timing accuracy of 10 microseconds and a frequency accuracy of 1 part in 100 billion. The time code is transmitted using a 100-Hz audio signal with pulse-width modulation using the IRIG-B time code format.
  4. Computers have a "real-time clock" -- a special hardware device (e.g., containing a quartz crystal) on the motherboard that maintains the time. It is always powered, even when you shut your computer off. Also, the motherboard has a small battery that is used to power the clock device even when you disconnect your computer from power. The battery doesn't last forever, but it will last at least a few weeks. This helps the computer keep track of the time even when your computer is shut off. The real-time clock doesn't need much power, so it's not wasting energy. If you take out the clock battery in addition to removing the main battery and disconnecting the power cable then the computer will lose track of time and will ask you to enter the time and date when you restart the computer.
  5. 1- the machine with WWV receiver is the time server 2-Periodically, no more that 𝛿 2𝑝 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 (delta) over 2 (rho) seconds, each machine sends a message to the time server asking it for current time.That machine reply as fast as possible with a message containing its current time. 3-when the sender gets the reply it can just set it clock to Cutc. _ we have two problems: 1-major: is that the sender clock may be faster than the time server clock. 2-minor: the delay that the reply that to be sent to the asking machine
  6. 1- (a)At 3:00, the time daemon tells the other machines its time and asks for theirs. 2- (b)they respond with how far ahead or behind the time daemon they are. 3-the time daemon computes the average and tells each machine how to adjust its clock.
  7. Any timestamp older than G can be removed from the table bcz all msgs that old have died out already. What a server crashes and then reboots it reloads G from the time stored on disk and increments it by the update period ∆𝑇 .
  8. 2- the disadvantage of this scheme is that if a client has a file cached for reading before another client can get a copy for writing, the server has to first ask the reading client to invalidate its copy. 5-When the lease expires, it just times out; there is no need to explicitly send a message telling the server that it has been purged from the cache.
  9. 1-Whenever a process wants to enter a critical region, it sends a request message to the coordinator stating which critical region it wants to enter and asking for permission. 2-If no other process is currently in that critical region, the coordinator sends back a reply granting permission. 3-When the reply arrives, the requesting process enters the critical region. 4-Now suppose that another process 2 ,  asks for permission to enter the same critical region. 5-The coordinator knows that a different process is already in the critical region, so it cannot grant permission. 6- the coordinator just refrains from replying, thus blocking process 2, which is waiting for a reply. Alternatively, it could send a reply saying "permission denied. 7-Either way, it queues the request from 2 for the time being. 8-When process 1 exits the critical region, it sends a message to the coordinator releasing its exclusive access. 9-The coordinator takes the first item off the queue of deferred requests and sends that process a grant message.
  10. 1-When a process wants to enter a critical region, it builds a message containing the name of the critical region it wants to enter, its process number, and the current time.  2-It then sends the message to all other processes, conceptually including itself. When a process receives a request message from another process, the action it takes depends on its state with respect to the critical region named in the message. Three cases have to be distinguished: 1. If the receiver is not in the critical region and does not want to enter it, it sends back an OK message to the sender. 2. If the receiver is already in the critical region, it does not reply. Instead, it queues the request. 3. If the receiver wants to enter the critical region but has not yet done so, it compares the timestamp in the incoming message with the one contained in the message that it has sent everyone. The lowest one wins. If the incoming message is lower, the receiver sends back an OK message. If its own message has a lower timestamp, the receiver queues the incoming request and sends nothing. -When it exits the critical region, it sends OK messages to all processes on its queue and deletes them all from the queue.
  11. 1-In software, a logical ring is constructed in which each process is assigned a position in the ring. 2-It does not matter what the ordering is. All that matters is that each process knows who is next in line after itself. 3-When the ring is initialized, process 0 is given a token. 4-The token circulates around the ring. it is passed from process k to process k+1. 5-the process enters the region, does all the work it needs to, and leaves the region. After it has exited, it passes the token along the ring. 6-Only one process has the token at any instant, so only one process can be in a critical region.  7-Since the token circulates among the processes in a well-defined order, starvation cannot occur. 8- Once a process decides it wants to enter a critical region, at worst it will have to wait for every other process to enter and leave one critical region.
  12. The centralized algorithm is simplest and also most efficient. It requires only three messages to enter and leave a critical region: a request and a grant to enter, and a release to exit. The distributed algorithm requires n–1 request messages, one to each of the other processes, and an additional n–1 grant messages, for a total of 2(n–1). With the token ring algorithm, the number is variable. If every process constantly wants to enter a critical region, then each token pass will result in one entry and exit, for an average of one message per critical region entered. -At the other extreme, the token may sometimes circulate for hours without anyone being interested in it. In this case, the number of messages per entry into a critical region is unbounded. Second domain: It takes only two message times to enter a critical region in the centralized case, but 2(n–1) message times in the distributed case, assuming that the network can handle only one message at a time. For the token ring, the time varies from 0 (token just arrived) to n–1 (token just departed). Conclusion Finally, all three algorithms suffer badly in the event of crashes. Special measures and additional complexity must be introduced to avoid having a crash bring down the entire system. It is slightly ironic that the distributed algorithms are even more sensitive to crashes than the centralized one. In a fault-tolerant system, none of these would be suitable, but if crashes are very infrequent, they are all acceptable.
  13. In this Fig. Both pro. 2 and 5 will be a coordinators. When both have gone around again both will be removed.
  14. P:287
  15. P:287
  16. P:287
  17. P:287 1- for point 1 No node can hold more than one token 2- The net effect is that if all tokens exert the same repulsion force, they will move away from each other and spread themselves evenly in the geometric space. This approach requires that nodes holding a token learn about other tokens. To this end, La et al.propose to use a gossiping protocol by which a token's force is disseminated throughout the network. If a node discovers that the total forces that are acting on it exceed a threshold, it will move the token in the direction of the combined forces, as showninFig. 6-23.
  18. Each of these children may execute one or more sub transactions, or fork off its own children The problem here is when system aborts and child proccess wok the p:168 -if the parent abort the transaction the child transaction will vanish to avoid this and not lose commited work the subtransaction is given private copy of all objects .
  19. 1- giving the transaction a private space ma be prohibitive. 2- if transaction do not want to change the file there is no need for private copy. 3-when file is opened for writing then it copied to work space
  20. 1- One of the processes involved functions as a coordinator. 2- the coordinator writes a log entry saying that it is starting the commit protocol. 3- then it sends msgs to the involved processes telling them to prepare to commit
  21. 1- If the process refrains from updating any files until it reaches the shrinking phase, failure to acquire some lock can be dealt with simply by releasing all locks, waiting a little while, and starting all over. 2-even two-phase locking, can lead to deadlocks. If two processes each try to acquire the same pair of locks but in the opposite order, a deadlock may result. The usual techniques apply here, such as acquiring all locks in some canonical order to prevent hold-and-wait cycles. Also possible is deadlock detection by maintaining an explicit graph of which process has which locks and wants which locks, and checking the graph for cycles. Finally, when it is known in advance that a lock will never be held longer than T sec, a timeout scheme can be used: if a lock remains continuously under the same ownership for longer than T sec, there must be a deadlock.
  22. first, a transaction always reads a value written by a committed transaction; therefore, one never has to abort a transaction because its calculations were based on a file it should not have seen. Second, all lock acquisitions and releases can be handled by the system without the transaction being aware of them: locks are acquired whenever a file is to be accessed and released when the transaction has finished. 
  23. 1- process 1 is waiting to local process 2 and 2 waiting for an external process 3 2- when a has to wait for some resource, ex. Pro. 0 blocking on pro.1. at that point a special probe message is generated and sent to the process holding the needed resources 3-the message consist of three numbers: the pro that just block, the process sending the message and the process to whom it is being sent 4-when the message arrives, the recipient checks to see if it itself is waiting for any processes. 5-If so, the message is updated, keeping the first field but replacing the second field by its own process nb. And the third one by the nb. Of the process it is waiting for. 6-If a message goes all the way around and comes back to the original sender, the process recognize its number and that a circle exist in the system so there is a deadlock 7- if pro 0 and pro 6 both initiates probes then they will both killed
  24. 1- timestamp is unique 2-when one process is about to block waiting for a resource that another process is using, a check is made to see which has a larger timestamp. 3-We can then allow the wait only if the waiting process has a lower timestamp (is older) than the process waited for. 4- In this manner, following any chain of waiting processes, the timestamps always increase, so cycles are impossible.  (a), an old process wants a resource held by a young process. In (b), a young process wants a resource held by an old process. In one case we should allow the process to wait; in the other we should kill it.