A deadlock is a situation where a set of processes is deadlocked because each process is holding a resource and waiting for the next resource obtained by another process.
Four Necessary conditions for deadlock to occur:-
- Mutual Exclusion: one or more than one resource is non-sharable only one process can use at the same time. or we can say If two processes cannot use the same resource at the same time.
- Hold and wait: A process waits for the same resource while holding another resource at the same time. or we can say - A process is holding at least one resource and waiting for another resource.
- NO Preemption: A resource cannot be taken from a process unless the process releases that resource .
- Circular wait: A set of processes are waiting for each other in circular form
Hence, When these 4 conditions occur then deadlock occurs.
Learn more about deadlock here:-https://brainly.com/question/25541016
#SPJ4