What is starvation?
Submitted by: AdministratorStarvation 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.
Submitted by: Administrator
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.
Submitted by: Administrator
Read Online Java Multi-Threading Job Interview Questions And Answers
Top Java Multi-Threading Questions
☺ | Explain deadlock? |
☺ | What is the sleep() method Data type for the parameter? |
☺ | Explain the difference between preemptive scheduling and time slicing? |
☺ | How many threads at a time can access a monitor? |
☺ | Name the default thread at the time of starting the program? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |