1.

What Is Starvation?

Answer»
  • Starvation is a situation when some threads acquired the shared resources for long time and therefore other threads are not able to access those resources and not able to do anything further.
  • 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 REQUIRE frequent synchronized access to that object will be blocked.
  • In JAVA, Starvation can be caused by inappropriate allocation of thread priorities.
  • A thread with low PRIORITY can be starved by the threads of higher priority if the higher priority threads do not release shared resources time to time.



Discussion

No Comment Found