Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Starvation (computer science)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Resource shortage in computers}} {{other uses|Starvation (disambiguation)}} In [[computer science]], '''resource starvation''' is a problem encountered in [[concurrent computing]] where a [[process (computing)|process]] is perpetually denied necessary [[System resource|resources]] to process its work.<ref>{{cite book |title=Modern Operating Systems |url=https://archive.org/details/modernoperatings00tane |url-access=registration |last=Tanenbaum |first=Andrew |author-link=Andrew Tanenbaum |year=2001 |publisher=Prentice Hall |isbn=0-13-092641-8 |pages=[https://archive.org/details/modernoperatings00tane/page/184 184–185] }}</ref> Starvation may be caused by errors in a scheduling or [[mutual exclusion]] algorithm, but can also be caused by [[resource leak]]s, and can be intentionally caused via a [[denial-of-service attack]] such as a [[fork bomb]]. When starvation is impossible in a [[concurrent algorithm]], the algorithm is called '''starvation-free''', '''lockout-freed'''<ref>{{cite book |title=The Art of Multiprocessor Programming |first1=Maurice |last1=Herlihy |author-link1=Maurice Herlihy |first2=Nir |last2=Shavit |author-link2=Nir Shavit |publisher=Elsevier |year=2012 |page=24 |isbn=9780123977953}}</ref> or said to have '''finite bypass'''.{{r|raynal}} This property is an instance of [[Safety and liveness properties|liveness]], and is one of the two requirements for any mutual exclusion algorithm; the other being [[Correctness (computer science)|correctness]]. The name "finite bypass" means that any process (concurrent part) of the algorithm is bypassed at most a finite number times before being allowed access to the [[shared resource]].<ref name="raynal">{{cite book |title=Concurrent Programming: Algorithms, Principles, and Foundations |first=Michel |last=Raynal |author-link=Michel Raynal |publisher=Springer Science & Business Media |year=2012 |isbn=978-3642320279 |pages=10–11}}</ref> ==Scheduling== Starvation is usually caused by an overly simplistic [[scheduling algorithm]]. For example, if a (poorly designed) [[Computer_multitasking|multi-tasking system]] always switches between the first two tasks while a third never gets to run, then the third task is being starved of [[CPU time]]. The scheduling algorithm, which is part of the [[Kernel (operating system)|kernel]], is supposed to allocate resources equitably; that is, the algorithm should allocate resources so that no process perpetually lacks necessary resources. Many operating system schedulers employ the concept of process priority. A high priority process A will run before a low priority process B. If the high priority process (process A) blocks and never yields, the low priority process (B) will (in some systems) never be scheduled—it will experience starvation. If there is an even higher priority process X, which is dependent on a result from process B, then process X might never finish, even though it is the most important process in the system. This condition is called a [[priority inversion]]. Modern scheduling algorithms normally contain code to guarantee that all processes will receive a minimum amount of each important resource (most often CPU time) in order to prevent any process from being subjected to starvation. In computer networks, especially wireless networks, [[scheduling algorithm]]s may suffer from scheduling starvation. An example is [[maximum throughput scheduling]]. Starvation is normally caused by [[Deadlock (computer science)|deadlock]] in that it causes a process to freeze. Two or more processes become deadlocked when each of them is doing nothing while waiting for a resource occupied by another program in the same set. On the other hand, a process is in starvation when it is waiting for a resource that is continuously given to other processes. Starvation-freedom is a stronger guarantee than the absence of deadlock: a mutual exclusion algorithm that must choose to allow one of two processes into a [[critical section]] and picks one arbitrarily is deadlock-free, but not starvation-free.{{r|raynal}} A possible solution to starvation is to use a scheduling algorithm with priority queue that also uses the [[Aging (scheduling)|aging]] technique. Aging is a technique of gradually increasing the priority of processes that wait in the system for a long time.<ref>{{cite book |title=Operating System Concepts |last=Galvin |first=Peter|year=2010 |publisher=Wiley India Edition |isbn=978-81-265-2051-0|page=193}}</ref> ==See also== * [[Dining philosophers problem]] ==References== {{reflist}} {{Processor scheduling}} [[Category:Concurrency (computer science)]] [[Category:Processor scheduling algorithms]] [[Category:Problems in computer science]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Other uses
(
edit
)
Template:Processor scheduling
(
edit
)
Template:R
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)