answersLogoWhite

0

When does a dead lock occur?

User Avatar

Anonymous

12y ago
Updated: 8/19/2019

• Deadlocks can occur in any concurrent system where processes

wait for each other and a cyclic chain can arise with each process

waiting for the next one in the chain.

• More specifically, deadlocks can occur in any system that satisfies

the four Coffman conditions (due to E. G. Coffman in 1971):

1. Mutual Exclusion Condition: a resource is either assigned to

one process or it is available

2. Hold and Wait Condition: processes already holding resources

may request new resources

3. No Preemption Condition: only a process holding a resource

may release it

4. Circular Wait Condition: two or more processes form a circular

chain where each process requests a resource that the next process in the chain holds

• Concurrent Java programs may satisfy these conditions, with the

object locks/monitors as the resources, so they may deadlock.

• We can avoid deadlocks by arranging our program so that one of

the Coffman conditions doesn't hold.

User Avatar

Wiki User

12y ago

What else can I help you with?