top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Concurrency? Expain with example Deadlock and Starvation.

+1 vote
238 views
What is Concurrency? Expain with example Deadlock and Starvation.
posted Dec 28, 2015 by Sathyasree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Concurrency
Concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other. The computations may be executing on multiple cores in the same chip, preemptively time-shared threads on the same processor, or executed on physically separated processors. A number of mathematical models have been developed for general concurrent computation including Petri nets, process calculi, the Parallel Random Access Machine model and the Actor model.
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.
1. Mutual exclusion. Only one process may use the shared resource at a time.
2. Hold and wait. More than one resource is involved and they are to be obtained one by one. That is processes may hold allocated resources while awaiting assignment of others.
3. No preemption. Once a resource is held by a process, it cannot be forcibly removed from the process.
4. Circular wait. A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain. In terms of graph theory, there is a directed circuit, in which processes and resources alternate exactly one by one,
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.
- See more at: http://interview.freshershome.com/windows/os-interview-questions/#sthash.zzI0jKhH.dpuf

answer Dec 29, 2015 by Shivaranjini
...