Resource management (computing): Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Reverted edit by 35.33.193.94 (talk) to last version by Frap
 
(5 intermediate revisions by 4 users not shown)
Line 1:
{{Short description|Techniques used by computers to manage components with limited availability}}
In [[computer programming]], '''resource management''' refers to techniques for managing [[System resource|resources]] (components with limited availability).
 
[[Computer program]]s may manage their own resources{{which|date=November 2016}} by using features exposed by [[programming language]]s ({{harvtxt|Elder|Jackson|Liblit|2008}} is a survey article contrasting different approaches), or may elect to manage them by a host – an [[operating system]] or [[virtual machine]] – or another program.
Line 24:
{{main|resource contention}}
 
In computer science, [https://www.techtarget.com/whatis/definition/resource-contention resource contention] refers to a conflict that arises when multiple entities attempt to access a shared resource, like random access memory, disk storage, cache memory, internal buses, or external network devices.
{{expand section|date=November 2016}}
 
==Memory management==
Line 36:
 
==Basic techniques==
The basic approach to resource management is to acquire a resource, do something with it, then release it, yielding code of the form (illustrated with opening a file in [[Python (programming language)|Python]]):
<syntaxhighlight lang="python">
f = open(filename)
Line 69:
</syntaxhighlight>
 
The above techniques – unwind protection (<code>finally</code>) and some form of encapsulation – are the most common approach to resource management, found in various forms in [[C Sharp (programming language)|C#]], [[Common Lisp]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Scheme (programming language)|Scheme]], and [[Smalltalk]],{{sfn|Beck|1997|pp=37–39}} among others; they date to the late 1970s in the [[NIL (programming language)|NIL]] dialect of Lisp; see {{section link|Exception handling|History}}. There are many variations in the implementation, and there are also significantly different [[#Approaches|approaches]].
 
== Approaches ==