Re: Wait Variable and Starvation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/18/06, Goldwyn Rodrigues <rgoldwyn@xxxxxxxxx> wrote:
Hi,

Talking about a design:

There is a system, where processes keep coming at random. Most of the
processes, wait on a global wait variable.

So when a wake_up is called all the processes wake up, however only a
certain number are allowed to execute. the rest go back to sleep till
the "certain number" processes have not freed the resources.

Can such a situation lead to starvation?

in theory no, it'll not lead to a starvation cause even if the rate at which the new processes are coming is greater than the rate at which the "certain number" processes will finish their work, some day each process will be executed for sure, as long as the newly coming processes are queued in a FIFO manner, but in practice it depends on how much the rate on the newly coming processes is great or than the rate of processes getting executed .. if it's much greater then maybe some processes will have to wait for days ...

Of what I have found. The sleep_on and wake_up sequence uses list_add
(not list_add_tail) and list_for_each, which I think shows a LIFO
behaviour. Taking the scheduler sequence also into consideration I
think it may lead to process starvation.

if i had understood what you've meant to explain .. the processes are handled in a LIFO manner .. this means that the newly coming processes will be executed before the older ones cause they are added to the head of the list when they call sleep and when wakeup is called some of the processes from the head of the list will be awakened .. right ?
if this was the case and the rate of the newly coming processes is greater than the rate of the executed processes this will sure lead to a starvation
this is in general .. correct me please if i had missed a point from what you've explained

Regards,

--
Goldwyn

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux