0% found this document useful (0 votes)
22 views3 pages

IAT III Ans Key Dis Comp

Uploaded by

Sakthivel V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

IAT III Ans Key Dis Comp

Uploaded by

Sakthivel V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MOHAMED SATHAK AJ COLLEGE OF ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


IAT 3 ANSWER KEY

PART-A

1. What is deadlock? What are the conditions for deadlock?


A deadlock occurs when two or more processes or threads are unable to move forward
because they are waiting for resources that are being held by other processes.

The conditions for deadlock to occur are:


 Mutual exclusion: Each resource can only be assigned to one process at a time.
 Hold and wait: A process can hold multiple resources and still request more
resources from other processes.
 No preemption: Resources that have already been granted access cannot be taken
away.
 Circular wait: A process is holding a resource and requires more of the resources
which are being held by other processes.

2. What is Mutual Exclusion?


Mutual exclusion is a program object that blocks multiple users from accessing the same
shared variable or data at the same time. With a critical section, a region of code in which
multiple processes or threads access the same shared resource, this idea is put to use in
concurrent programming.

3. List out the types of models of Deadlock.


Resource allocation graph
A system is not deadlocked if the resource-allocation graph has no cycles. If the graph has
cycles and each resource category has only one instance, then a deadlock exists.
Banker's algorithm
This algorithm simulates resource allocation to processes to determine if the system will be
in a safe state.
Unrestricted model
This model does not limit the number of resources that a transaction can request

4.What is the check point in the recovery system? How is it useful?


Checkpoints are used for recovery if there is an unexpected shutdown in the database.
They can also be used for performance optimization and auditing. Recovery: In the event of an
unexpected shutdown, checkpoints provide a recovery point, ensuring the database can be
restored to a consistent state.

5.State Byzantine agreement problem.


The Byzantine agreement problem was first defined by Lamport. The solution was
also given by Lamport first of all under the situation of processor failure. According to the
concept of Byzantine agreement problem, a source processor is taken to broadcast its initial
value to another processor in the system.
6.Write the purpose of using checkpoints. Also explain the types of checkpoints.
A checkpoint is a stage in the eukaryotic cell cycle at which the cell examines internal
and external cues and "decides" whether or not to move forward with division.
 Coordinated checkpointing: Processes ensure that their checkpoints are consistent,
usually with a two-phase commit protocol algorithm.
 Uncoordinated checkpointing: Each process checkpoints its own state
independently.
 Permanent checkpoints: Cannot be undone and guarantee that the computation
needed to reach the checkpointed state will not be repeated.
 Tentative checkpoints: Can be undone or changed to be a permanent checkpoint.
 Blocking checkpoints: Processes remain blocked until the entire checkpointing
activity is complete.
 Non-blocking checkpoints: Processes need not stop their execution while taking
checkpoints.

7. How beneficial is the Chandy – Misra – Haas algorithm in the AND model and OR
model?
The Chandy-Misra-Haas (CMH) algorithm is considered one of the best deadlock detection
algorithms for distributed systems, and is especially useful in the AND model:
AND model
The CMH algorithm is an edge-chasing algorithm that uses a unique message to detect
deadlocks in distributed systems. The worst-case complexity of the algorithm is
s(s−1)/2s transmit steps, where is the number of processes in the cycle.
Benefits
The CMH algorithm is a fully distributed algorithm that uses probes to detect
deadlocks. When a process requests a resource and it fails or times out, the process sends a
probe message to each process that holds one or more of its requested resources. The probe
message contains the IDs of the blocked process, the sending process, and the receiving
process.

8.Define Deadlock Avoidance.

Deadlock avoidance is a method used in computer systems to ensure that processes


do not enter into a deadlock situation. Instead of just setting rules like in deadlock prevention,
deadlock avoidance continuously monitors the state of the system and makes decisions on-
the-fly to keep processes from getting stuck.

9.Which are the three basic approaches for implementing distributed mutual exclusion?
The three basic approaches for implementing distributed mutual exclusion are:
 Token-based approach: Only one process at a time has the token and the lock on the
resource. This guarantees mutual exclusion and well-defined order, so starvation cannot
occur. However, if a token is lost, it will need to be regenerated.
 Non-token-based approach: A distributed algorithm that uses message exchange to
realize mutual exclusion among nodes in a computer network.
 Quorum-based approach: Another approach for implementing distributed mutual
exclusion.

10. List the requirements of consensus algorithm to hold for execution.


A consensus algorithm must meet several requirements to hold for execution, including:
 Consistency: All correct processes must agree on the same value
 Availability: The protocol should be available
 Fault tolerance: The protocol should be able to tolerate faults
 Scalability: The protocol should be scalable
 Privacy: The protocol should be private
 Security: The protocol should be secure
 Resistance to attacks: The protocol should be resistant to attacks
 Node ID management: The protocol should be able to manage node IDs
 Correctness proof: The protocol should have correctness proof

11. What is the difference between agreement and consensus problem?


The main difference between the agreement and consensus problems is that in the agreement
problem, only one process has an initial value, while in the consensus problem, all processes
have an initial value:
Agreement problem
A single processor initializes a value, and all nonfaulty processors must agree on that value.
Consensus problem
Each processor has its own initial value, and all nonfaulty processors must agree on a single
common value.
12.What are the application of agreement algorithm?
Agreement algorithms are used in many applications, including:
Decentralized networks
Agreement algorithms are used to achieve trust and security in decentralized networks, such
as blockchain.
Database systems
Agreement algorithms are used to decide whether to commit or abort a transaction in a
database.
Distributed systems
Agreement algorithms are used to ensure reliability and fault tolerance in distributed
systems.
Recordkeeping
Agreement algorithms are useful for recordkeeping.

You might also like