I don't think starvation is realted to processor resources, because for example in this thread the green cars are still doing work, it's more about fairness because the yellow cars are not able to do their work.
In other words, some processes on the system will be getting all the CPU time so processor is still used, but there are other processes that never get to run and get starved.
I never knew that there were so many different forms of... I am not sure actually what category deadlock, livelock and starvation fall into but I was never aware before this class that there was more than just deadlock. The primary difference between deadlock and livelock is that livelock gives the illusion of a process performing work but the processes are not performing any meaningful work. With starvation, while the program is allowed to run to completion, one process may end up having to wait for another process to finish so the resources it needs to run are freed.
I would therefore imagine that solving starvation in code is more close to optimizing the performance of code as opposed to fixing a bug that is causing critical stalls.
I was wondering how we can identify places in our code where starvation might be happening. Is exponential backoff one way of fixing that?
I guess you could try to profile your code to pinpoint the bottlenecks and then I'd write some print statements to see which threads are always obtaining the resource, which could point you to starvation. I'm actually not sure if exponential backoff would work in this case because if A always obtains the resource and B is exponentially backing-off, then during this time A could in theory complete its work and re-obtain the resource, starving out B.
There are also some tools that can yelp identifying these types of issues in your program. One example that comes to mind is Eraser (https://homes.cs.washington.edu/~tom/pubs/eraser.pdf).
Please log in to leave a comment.
Is starvation related to processor utilization at all? Both seem like having available resources that are not used