Content deleted Content added
Disambiguated: Kernel (computing) → kernel (operating system) |
m Reverted 1 edit by 24.169.1.62 (talk) to last revision by Maxeto0910 |
||
(42 intermediate revisions by 35 users not shown) | |||
Line 1:
{{short description|Particular execution of a computer program}}
[[File:Concepts- Program vs. Process vs. Thread.jpg|thumb|[[Computer program|Program]] vs. Process vs. [[Thread (computing)|Thread]] <br/>[[Scheduling (computing)|Scheduling]], [[Preemption (computing)|Preemption]], [[Context switch|Context Switching]]|400x400px]]
In [[computing]], a '''process''' is the [[Instance (computer science)|instance]] of a [[computer program]] that is being executed by one or many [[
While a computer program is a passive collection of [[Instruction set|instructions]] typically stored in a file on disk, a process is the execution of those instructions after being loaded from the disk into memory. Several processes may be associated with the same program; for example, opening up several instances of the same program often results in more than one process being executed.
[[Computer multitasking|Multitasking]] is a method to allow multiple processes to share [[Central processing unit|processors]] (CPUs) and other system resources. Each CPU (core) executes a single
A common form of multitasking is provided by CPU's [[time-sharing]] that is a method for interleaving the execution of users' processes and threads, and even of independent kernel tasks
For security and reliability, most modern [[operating system]]s prevent direct [[inter-process communication|communication]] between independent processes, providing strictly mediated and controlled inter-process communication
==Representation==
[[File:
[[File:KSysGuard
In general, a computer system process consists of (or is said to ''own'') the following resources:
* An ''image'' of the executable [[machine code]] associated with a program.
* Memory (typically some region of [[virtual memory]]); which includes the executable code, process-specific data (input and output), a [[call stack]] (to keep track of active [[subroutine]]s and/or other events), and a [[
* Operating system descriptors of resources that are allocated to the process, such as [[file descriptor]]s ([[Unix]] terminology) or [[Handle (computing)|handles]] ([[Microsoft Windows|Windows]]), and data sources and sinks.
* [[Computer security|Security]] attributes, such as the process owner and the process' set of permissions (allowable operations).
Line 23 ⟶ 24:
The operating system holds most of this information about active processes in data structures called [[process control block]]s. Any subset of the resources, typically at least the processor state, may be associated with each of the process' [[Thread (computer science)|threads]] in operating systems that support threads or ''child'' processes.
The operating system keeps its processes separate and allocates the resources they need, so that they are less likely to interfere with each other and cause system failures (e.g., [[deadlock (computer science)|deadlock]] or [[thrashing (computer science)|thrashing]]). The operating system may also provide mechanisms for [[inter-process communication]] to enable processes to interact in safe and predictable ways.
==Multitasking and process management==
{{Main|Process management (computing)}}
A [[Computer multitasking|multitasking]] [[operating system]] may just switch between processes to give the appearance of many processes [[Execution (computing)|executing]] simultaneously (that is, in [[Parallel computing|parallel]]), though in fact only one process can be executing at any one time on a single [[Central processing unit|CPU]] (unless the CPU has multiple cores, then [[
It is usual to associate a single process with a main program, and child processes with any spin-off, parallel processes, which behave like [[Asynchrony (computer programming)|asynchronous]] subroutines. A process is said to ''own'' resources, of which an ''image'' of its program (in memory) is one such resource. However, in multiprocessing systems ''many'' processes may run off of, or share, the same [[Reentrancy (computing)|reentrant]] program at the same ___location in memory, but each process is said to own its own ''image'' of the program.
Line 36 ⟶ 37:
The above description applies to both processes managed by an operating system, and processes as defined by [[process calculus|process calculi]].
If a process requests something for which it must wait, it will be blocked. When the process is in the [[Process state|blocked state]], it is eligible for swapping to disk, but this is transparent in a [[virtual memory]] system, where regions of a process's memory may be really on disk and not in [[Computer data storage#Primary storage|main memory]] at any time.
===Process states===
{{Main|Process state}}
[[File:Process states.svg|right|300px|thumb|The various process states, displayed in a [[state diagram]], with arrows indicating possible transitions between states
An operating system [[kernel (operating system)|kernel]] that allows multitasking needs processes to have [[process states|certain states]]. Names for these states are not standardised, but they have similar functionality.<ref name="OSC Chap4"/>
Line 53 ⟶ 54:
When processes need to communicate with each other they must share parts of their [[address space]]s or use other forms of inter-process communication (IPC).
For instance in a [[Shell (computing)|shell]] [[Pipeline (computing)|pipeline]], the output of the first process
It is even possible for two or more processes to be running on different machines that may run different operating system (OS), therefore some mechanisms for communication and synchronization (called [[communications protocol]]s for distributed computing) are needed (e.g., the
==History==
Line 64 ⟶ 65:
Programs consist of sequences of instructions for processors. A single processor can run only one instruction at a time: it is impossible to run more programs at the same time. A program might need some [[System resource|resource]], such as an input device, which has a large delay, or a program might start some slow operation, such as sending output to a printer. This would lead to processor being "idle" (unused). To keep the processor busy at all times, the execution of such a program is halted and the operating system switches the processor to run another program. To the user, it will appear that the programs run at the same time (hence the term "parallel").
Shortly thereafter, the notion of a "program" was expanded to the notion of an "executing program and its context". The concept of a process was born, which also became necessary with the invention of [[Reentrancy (computing)|re-entrant code]]. [[Thread (computer science)|Threads]] came somewhat later. However, with the advent of concepts such as [[time-sharing]], [[computer network]]s, and multiple-CPU [[shared memory]] computers, the old "multiprogramming" gave way to true [[Computer multitasking|multitasking]], [[multiprocessing]] and, later, [[
==See also==
{{div col|colwidth=22em}}
* [[Background process]]
* [[Code cave]]
* [[Child process]]
* [[Exit (system call)|Exit]]
Line 96 ⟶ 99:
*[http://www.processlibrary.com/ Online Resources For Process Information]
*[http://www.file.net/ Computer Process Information Database and Forum]
*[https://osnote.space/process-models-with-process-creation-termination-methods.html Process Models with Process Creation & Termination Methods] {{Webarchive|url=https://web.archive.org/web/20210206000025/https://osnote.space/process-models-with-process-creation-termination-methods.html |date=2021-02-06 }}
{{Parallel Computing}}
|