Deadlock Flashcards

1
Q

what is deadlock

A

Infinite waiting is called as deadlock.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

when does deadlock occur

A

-> mutual exclusion: only one process can access the resource at a given time.
-> hold and wait: having one resource and waiting for the other.
->no-preemption: one process cannot preempt in between.
-> circular wait: it should have one resource and wait for the other which is acquired by another process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

methods to handle deadlock

A

-> read files can be accessed by many process.
->when ever a process wants a resource make sure it is not holding any other resource.
->if one process is not able to get the resource it needs then it should preempt the resources it is holding.
->ensure proper ordering of resource allocation that is both the process try to acquire R1 first then R2.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

bankers algorithm

A

when a process request a resource make sure that the os will be able to allocate all the resources it needs which is safe state then only allocate the resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

deadlock recovery

A

Process termination:
-> abort all the process that are causing deadlock
-> abort process one by one till deadlock is removed.
Resource Preemption
-> remove some resources and give it to other process to avoid deadlock.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly