What is starvation?

2
Some conditions can prevent the progress of running processes or threads, two of these conditions are called dead-lock and live-lock , where what I extracted from information was that dead-lock refers to processes that are blocking each other , preventing execution from flowing and live-lock refers to processes that prevent each other from progressing but do not interrupt execution.

It was not very clear to me, and I think it would be interesting to talk about it, maybe more people would be interested and so I brought the issue here.

  • How does this work?
  • In what scenario is this useful? or even get in the way?
  • Can you give any examples of this?
asked by anonymous 04.09.2018 / 20:54

1 answer

2

Starvation is a concept that does not refer directly to deadlock / livelock.

Starvation is when a process can not be executed in any way, because there are always higher priority processes to run, so the process "hungry" never gets processing time.

Follow the process state diagram in Linux.

When you run a process, it starts in initial state and then goes to ready .

Starvation occurs when higher priority processes appear whenever they have a lower priority process active and want to call the kernel. In that case, the highest priority processes get access to the kernel, and the other process just waits for permission, which never comes.

It can not act and it stops, doing nothing, occupying memory and processing time (since the OS has to do the process scheduling!) of the processor doing nothing.

Starvation always gets in the way, because it is processor time / kernel time / wasted memory, because it is a process that wants to be executed and stays in memory, but it can never definitively complete its flow.

The Windows process scheduler, if I'm not mistaken, it makes use of a dynamic priority system where the process starts with its normal priority, but as it goes stationary, its priority begins to increase form that he eventually sees a kernel time.

(Any error, please correct)

    
04.09.2018 / 21:21