What is deadlock? How do you avoid it?

Answer Posted / sagarika mishra

A set of processes is deadlocked if each process in the set
is waiting for an event that only another process in the
set can cause (including itself).

Waiting for an event could be:

waiting for access to a critical section
waiting for a resource Note that it is usually a non-
preemptable (resource). pre-emptable resources can be
yanked away and given to another.
deadlock avoided by:-
Resource allocation state:
# of available / allocated instances of each type
maximum demand of each process
Safe sequence: For an allocation state, a sequence
hP1; : : : ; Pni is safe if for each Pi, the maximum
resources that
Pi can request can be satised by currently available
resources
+ resources held by all Pj (j < i)
Safe state: System istb in safe state if there exists a safe
sequence consisting of all processes

Is This Answer Correct ?    18 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are positional parameters?

478


What is a Kernel?

571


Which is your favorite editor, shell, programming shell and why?

2072


How do I boot up my computer?

507


How To Enable & Disable Quorum?

600






Is 4 cores enough for streaming?

590


What is the meaning of slosh login in nfs?

2095


What is the difference between the OS which you use and other OSs?

565


Directories can be implemented either as "special files" that can only be accessed in limited ways, or as ordinary data files. What are the advantages and disadvantages of each approach?

4006


Which one is the best operating system?

520


How can I clean up my computer?

547


Can I delete old updates to free up disk space?

512


How do you restart a crashed laptop?

576


How do I upgrade my operating system?

539


How do I combine multiple folders on a mac?

529