top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is starvation in context of multi-threading?

+1 vote
647 views
What is starvation in context of multi-threading?
posted Apr 18, 2016 by anonymous

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

1 Answer

0 votes

Starvation is a problem, where a process is perpetually denied necessary resources. Without those resources, the program can never finish its task. Starvation is related to deadlock. Deadlock occurs when two programs each hold resources the other needs to finish, and neither is willing to give them up. Starvation occurs when one program holds resources the other needs, but is unwilling to give them up.

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. Starvation occurs when one thread cannot access the CPU because one or more other threads are monopolizing the CPU. In Java, thread starvation can be caused by setting thread priorities inappropriately. A lower-priority thread can be starved by higher-priority threads if the higher-priority threads do not yield control of the CPU from time to time.

answer Apr 19, 2016 by Manikandan J
Similar Questions
0 votes

I heard the term "worker thread" and other types of threads such as "system thread" and "user thread".
For me a thread is nothing but a lite weight process and multi-threaded design is chosen for a software development when there are multiple task in the application/system and those tasks can be executed independently.
I want to know when these different terms are used like worker thread, user thread and system thread ?

...