What is Concurrency? Explain with example Deadlock and Starvation?

Questions by Beena   answers by Beena

Showing Answers 1 - 5 of 5 Answers

shikha

  • Oct 14th, 2005
 

when two processes want to acqire the same resource

  Was this answer useful?  Yes

peter

  • Jan 14th, 2006
 

A {
 wait_for(lock_1) {
  do something that takes time
  wait_for(lock_2) {
   do something
  }
 }
}

B {
 wait_for(lock_2) {
  do something that takes time
  wait_for(lock_1) {
   do something
  }
 }
}

start A
start B


 A will be holding lock_1, waiting for lock_2
and B will be holding lock_2, waiting for lock_1

hence, deadlock occurs

raj

  • May 17th, 2007
 

Deadlock:

Two processes are said to be in deadlock situation if process A holding onto resources required for process B and where as B holding onto the resources required for process A.

Starvation:

This is mostly happens in time sharing systems in which the process which requires less time slot is waiting for the large process to finish and to release the resources, but the large process holding the resources for long time (almost for forever) and the process that requires small time slot goes on waiting. Such situation is starvation for small process.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions