Sam has designed an application. It segregates tasks that are critical and executed frequently from tasks that are non critical and executed less frequently. He has prioritized these tasks based on their criticality and frequency of execution. After close scrutiny, he finds that the tasks designed to be non critical are rarely getting executed.
From what kind of problem is the application suffering?
A.
race condition
B.
starvation
C.
deadlock
D.
livelock
Explanation:
Starvation describes a situation where a thread is unable to gain regular access to shared resources and is unable to make progress. This happens when shared resources are made unavailable for long periods by “greedy” threads. For example, suppose an object provides a synchronized method that often takes a long time to return. If one thread invokes this method frequently, other threads that also need frequent synchronized access to the same object will often be blocked.Reference: The Java Tutorial, Starvation and Livelock
Hi
the answer is B), isn’t it?
And another short explanation for the different between livelock and starvation:
http://stackoverflow.com/questions/6411803/differences-if-any-among-livelock-and-starvation-in-operating-systems
“Livelock is a special case of resource starvation where two processes follow an algorithm for resolving a deadlock that results in a cycle of different locked states because each process is attempting the same strategy to avoid the lock.
Starvation itself can occur for one process without another process being cyclically blocked; in this case no livelock exists, just a single unfortunate process that gets no resources allocated by the scheduler.”
Yes the right answer is B. Starvation!
Thanks Julia.