Content deleted Content added
AsmCoder110 (talk | contribs) m Add `to` |
m Dating maintenance tags: {{Unsourced section}} |
||
(156 intermediate revisions by 90 users not shown) | |||
Line 1:
{{Short description|Concurrent execution of multiple processes}}
[[File:Desktop-Linux-Mint.png
[[File:Microsoft_Windows_1.01_multitasking.png|thumb|
▲[[File:Desktop-Linux-Mint.png|thumb|This computer is running linux ming(ubuntu) XCFE desktop environment VLC, GIMP, VIM, Calculator, Calendar and Firefox.|thumb|right|350px|Modern desktop operating systems are capable of handling large numbers of different processes at the same time. This screenshot shows [[Linux Mint]] running simultaneously [[Xfce]] desktop environment, [[Firefox]], a calculator program, the built-in calendar, [[Vim (text editor)|Vim]], [[GIMP]], and [[VLC media player]].]]
▲[[File:Microsoft_Windows_1.01_multitasking.png|thumb|right|Multitasking capabilities of [[Microsoft Windows 1.0|Microsoft Windows 1.01]] released in 1985, here shown running the MS-DOS Executive and Calculator programs]]
In [[computing]], '''multitasking''' is
Multitasking does
Multitasking is a common feature of computer operating systems since at least the 1960s. It allows more efficient use of the computer hardware; when a program is waiting for some external event such as a user input or an [[input/output]] transfer with a peripheral to complete, the central processor can still be used with another program. In a [[time-sharing]] system, multiple human operators use the same processor as if it was dedicated to their use, while behind the scenes the computer is serving many users by multitasking their individual programs. In [[multiprogramming]] systems, a task runs until it must wait for an external event or until the operating system's [[Scheduling (computing)|scheduler]] forcibly swaps the running task out of the CPU. [[Real-time computing|Real-time]] systems such as those designed to control industrial robots, require timely processing; a single processor might be shared between calculations of machine movement, communications, and user interface.<ref>Anthony Ralston, Edwin D. Reilly (ed),''Encyclopedia of Computer Science Third Edition'', Van Nostrand Reinhold, 1993, {{ISBN|0-442-27679-6}}, articles "Multitasking" and "Multiprogramming"</ref>
Often multitasking operating systems include measures to change the priority of individual tasks, so that important jobs receive more processor time than those considered less significant. Depending on the operating system, a task might be as large as an entire application program, or might be made up of smaller [[thread (computing)|threads]] that carry out portions of the overall program.
The term "multitasking" has become an international term, as the same word is used in many other languages such as German, Italian, Dutch, Danish and Norwegian.▼
A processor intended for use with multitasking operating systems may include special hardware to securely support multiple tasks, such as [[memory protection]], and [[protection ring]]s that ensure the supervisory software cannot be damaged or subverted by user-mode program errors.
▲The term "multitasking" has become an international term, as the same word is used in many other languages such as German, Italian, Dutch, Romanian, Czech, Danish and Norwegian.
== Multiprogramming ==
In the early days of computing, [[CPU time]] was expensive, and [[peripheral]]s were very slow. When the computer ran a program that needed access to a peripheral, the central processing unit (CPU) would have to stop executing program instructions while the peripheral processed the data. This was usually very inefficient. Multiprogramming is a computing technique that enables multiple programs to be concurrently loaded and executed into a computer's memory, allowing the CPU to switch between them swiftly. This optimizes CPU utilization by keeping it engaged with the execution of tasks, particularly useful when one program is waiting for I/O operations to complete.
The [[Bull Gamma 60]], initially designed in 1957 and first released in 1960, was the first computer designed with multiprogramming in mind. Its architecture featured a central memory and a Program Distributor feeding up to twenty-five autonomous processing units with code and data, and allowing concurrent operation of multiple clusters.
The first computer using a multiprogramming system was the British ''[[LEO (computer)#Applications and successors|Leo III]]'' owned by [[J. Lyons and Co.]] During [[batch processing]], several different programs were loaded in the computer memory, and the first one began to run. When the first program reached an instruction waiting for a peripheral, the context of this program was stored away, and the second program in memory was given a chance to run. The process continued until all programs finished running.{{citation needed|date=July 2013}}▼
▲
Multiprogramming
== {{Anchor|COOP|Cooperative multitasking/time-sharing}}Cooperative multitasking ==
{{Main|Cooperative multitasking}}
Early multitasking systems used applications that voluntarily ceded time to one another. This approach, which was eventually supported by many computer [[operating system]]s, is known today as cooperative multitasking. Although it is now rarely used in larger systems except for specific applications such as [[CICS]] or the [[JES2]] subsystem, cooperative multitasking was once the only scheduling scheme employed by [[Microsoft Windows
▲Early multitasking systems used applications that voluntarily ceded time to one another. This approach, which was eventually supported by many computer [[operating system]]s, is known today as cooperative multitasking. Although it is now rarely used in larger systems except for specific applications such as [[CICS]] or the [[JES2]] subsystem, cooperative multitasking was once the scheduling scheme employed by [[Microsoft Windows]] (prior to [[Windows 95]] and [[Windows NT]]) and [[Classic Mac OS]] (prior to [[macOS|Mac OS X]]) in order to enable multiple applications to be run simultaneously. [[Windows 9x]] also used cooperative multitasking, but only for 16-bit legacy applications, much the same way as pre-[[Mac OS X Leopard|Leopard]] [[PowerPC]] versions of Mac OS X used it for [[Classic (Mac OS X)|Classic]] applications. The network operating system [[NetWare]] used cooperative multitasking up to NetWare 6.5. Cooperative multitasking is still used today on [[RISC OS]] systems.<ref>
{{cite web
|url = http://www.riscos.info/index.php/Preemptive_multitasking
|title = Preemptive multitasking
|date = 2009-11-03 |
|website = riscos.info
}}</ref>
Line 40 ⟶ 38:
== Preemptive multitasking ==
{{Main|Preemption (computing)#Preemptive multitasking}}
[[File:Kubuntu_21.04_(KDE_Plasma_5)_-_Virtual_Desktops.png|thumb|Kubuntu (KDE Plasma 5) four [[Virtual desktop]]s running multiple programs at the same time]]
Preemptive multitasking allows the computer system to more reliably guarantee to each process a regular "slice" of operating time. It also allows the system to deal rapidly with important external events like incoming data, which might require the immediate attention of one or another process. Operating systems were developed to take advantage of these hardware capabilities and run multiple processes preemptively. Preemptive multitasking was implemented in [[TOPS-10|the PDP-6 Monitor]] and [[
| url = http://www.ibiblio.org/team/intro/unix/what.html
| title = UNIX, Part One | work = The Digital Research Initiative
| date = 2002-01-30 |
| publisher = ibiblio.org
}}</ref> as well as modern versions of Windows.
Possibly the earliest preemptive multitasking OS available to home users was [[Microware]]'s [[OS-9]], available for computers based on the [[Motorola 6809]] such as the [[TRS-80 Color Computer 2]],<ref name="rainbow198309_dynamicuno">{{ cite magazine | url=https://archive.org/details/198309Rainbow/page/236/mode/2up | title=Dynamic Uno | magazine=The Rainbow | last1=Downard | first1=Dan | date=September 1983 | access-date=9 May 2024 | pages=236–240 }}</ref> with the operating system supplied by Tandy as an upgrade for disk-equipped systems.<ref name="tandyrsc11">{{ cite book | url=https://archive.org/details/RSC-11_Computer_Catalog_1984_Radio_Shack_a/page/n52/mode/1up | title=1984 TRS-80 Catalog | publisher=Tandy Corporation | date=1984 | access-date=14 May 2024 | pages=53–54 }}</ref> [[Sinclair QDOS]] on the [[Sinclair QL]] followed in 1984, but it was not a big success. Commodore's [[Amiga]] was released the following year, offering a combination of multitasking and multimedia capabilities. Microsoft made preemptive multitasking a core feature of their flagship operating system in the early 1990s when developing [[Windows NT 3.1]] and then [[Windows 95]]. In 1988 Apple offered [[A/UX]] as a [[UNIX System V]]-based alternative to the [[Classic Mac OS]]. In 2001 Apple switched to the [[NeXTSTEP]]-influenced [[Mac OS X]].
A similar model is used in [[Windows 9x]] and the [[Windows NT|Windows NT family]], where native 32-bit applications are multitasked preemptively
▲A similar model is used in [[Windows 9x]] and the [[Windows NT|Windows NT family]], where native 32-bit applications are multitasked preemptively, and legacy 16-bit [[Windows 3.1x|Windows 3.x]] programs are multitasked cooperatively within a single process, although in the NT family it is possible to force a 16-bit application to run as a separate preemptively multitasked process.<ref>{{cite magazine|url=http://www.smartcomputing.com:80/editorial/article.asp?article=articles%2F2005%2Fs1606%2F08s06%2F08s06.asp|magazine=[[Smart Computing]]|title=Windows 2000 &16-Bit Applications|volume=16|issue=6|pages=32–33|date=June 2006|author=Joseph Moran|archive-url=https://web.archive.org/web/20090125104811/http://www.smartcomputing.com/editorial/article.asp?article=articles%2F2005%2Fs1606%2F08s06%2F08s06.asp|archive-date=January 25, 2009|deadurl=yes|df=}}</ref> 64-bit editions of Windows, both for the [[x86-64]] and [[Itanium]] architectures, no longer provide support for legacy 16-bit applications, and thus provide preemptive multitasking for all supported applications.
== Real time ==
Another reason for multitasking was in the design of [[real-time computing]] systems, where there are a number of possibly unrelated external activities needed to be controlled by a single processor system. In such systems a hierarchical interrupt system is coupled with process prioritization to ensure that key activities were given a greater share of available [[process time]].<ref>{{
== Multithreading ==
[[Thread (
| url = http://www.redbooks.ibm.com/redpapers/pdfs/redp4285.pdf
| title = Linux Performance and Tuning Guidelines
| date = April 25, 2008
| | author1 = Eduardo Ciliendo
| author2 = Takechika Kunimasa | website = redbooks.ibm.com
| publisher = [[IBM]] | archive-url = https://web.archive.org/web/20150226022205/http://www.redbooks.ibm.com/redpapers/pdfs/redp4285.pdf
}}</ref><ref>{{cite web▼
| archive-date = February 26, 2015
| url-status = dead
▲ }}</ref><ref>{{cite web
| url = http://www.linfo.org/context_switch.html
| title = Context Switch Definition
| date = May 28, 2006
| | website = linfo.org
| archive-url = https://web.archive.org/web/20100218115342/http://www.linfo.org/context_switch.html
}}</ref><ref>{{cite web▼
| archive-date = February 18, 2010
| url-status = dead
▲ }}</ref><ref>{{cite web
| url = http://www.tldp.org/FAQ/Threads-FAQ/Types.html
| title = What are threads (user/kernel)?
| date = September 8, 1997 |
| website = tldp.org
}}</ref>
While threads are scheduled preemptively, some operating systems provide a variant to threads, named ''[[Fiber (computer science)|fiber]]s'', that are scheduled cooperatively. On operating systems that do not provide fibers, an application may implement its own fibers using repeated calls to worker functions. Fibers are even more lightweight than threads, and somewhat easier to program with, although they tend to lose some or all of the benefits of threads on [[multiprocessing|machines with multiple processors]].
Accessed on February 19, 2019</ref>
Some systems directly support [[Multithreading (computer hardware)|multithreading in hardware]].▼
▲Some systems directly support [[Multithreading (computer
== Memory protection ==
{{Main|Memory protection}}
{{unsourced section|date=March 2025}}
Essential to any multitasking system is to safely and effectively share access to system resources. Access to memory must be strictly managed to ensure that no process can inadvertently or deliberately read or write to memory locations outside the process's address space. This is done for the purpose of general system stability and data integrity, as well as data security.
Line 96 ⟶ 103:
== Memory swapping ==
Use of a [[Virtual memory|swap file]] or swap partition is a way for the operating system to provide more memory than is physically available by keeping portions of the primary memory in [[secondary storage]]. While multitasking and memory swapping are two completely unrelated techniques, they are very often used together, as swapping memory allows more tasks to be loaded at the same time. Typically, a multitasking system allows another process to run when the running process hits a point where it has to wait for some portion of memory to be reloaded from secondary storage.<ref>{{
== Programming ==
Over the years, multitasking systems have been refined. Modern operating systems generally include detailed mechanisms for prioritizing processes, while [[symmetric multiprocessing]] has introduced new complexities and capabilities.<ref>{{
▲Over the years, multitasking systems have been refined. Modern operating systems generally include detailed mechanisms for prioritizing processes, while [[symmetric multiprocessing]] has introduced new complexities and capabilities.{{citation needed|date=July 2013}}
== See also ==
Line 114 ⟶ 115:
{{Reflist}}
{{Operating
{{Parallel computing}}
{{Authority control}}
{{DEFAULTSORT:Computer Multitasking}}
|