What is starvation (starvation)?

Asked

Viewed 5,505 times

4

Some conditions may prevent progress in the execution of 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 the execution flow and live-lock refers to processes that prevent each other from progressing, but do not interrupt the execution.

It wasn’t 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 question here.

  • How it works?
  • In what scenario is this useful? or even can hinder?
  • Can you give any example of this?

1 answer

5

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

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

Follow the process state diagram on Linux.

inserir a descrição da imagem aqui

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

Starvation occurs when higher priority processes appear whenever you have a lower priority process active and want to call the kernel. In this case, the most priority processes have access to the kernel and the other process is just waiting for permission, which never arrives.

It cannot act and stands still, doing nothing, occupying memory and processing time (since the OS has to scale processes!) of the processor without doing anything.

Starvation always gets in the way, as it is kernel/processor time/time/time spent (a), because it is a process wanting to run and that stays in memory, but 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 gets stuck, your priority starts to increase so that it eventually sees a kernel time.

(Any mistakes, please correct)

  • You kill a request (can be any execution head, as process, thread or whatever it is) hungry when it doesn’t allow her to move on and not murder him. This means that it can even occur in a single concurrent process with itself. For example, on a crossing with preferential, and you are on PARE and have an intense and infinite flow in the preferred, the process of your car will suffer starvation. The same can happen to readers and writers if the system always gives preference to readers and never to some writer

  • That answer on the problem of gluttonous philosophers talks about starvation. In fact, I found very humorous the way it was presented

Browser other questions tagged

You are not signed in. Login or sign up in order to post.