Process (computing): Difference between revisions

Content deleted Content added
Process states: no sentence
No edit summary
Tags: Reverted references removed Visual edit Mobile edit Mobile web edit
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 [[thread (computing)|threads]]. There are many different process models, some of which are light weight, but almost all processes (even entire [[virtual machine]]smachines) are rooted in an [[operating system]] (OS) process which comprises the program code, assigned system resources, physical and logical access permissions, and data structures to initiate, control and coordinate execution activity. Depending on the OS, a process may be made up of multiple threads of execution that execute instructions [[Concurrency (computer science)|concurrently]].<ref name="OSC Chap4">{{cite book |last1=Silberschatz |first1=Abraham |author-link=Abraham Silberschatz |last2=Cagne |first2=Greg |last3=Galvin |first3=Peter Baer |date=2004 |title=Operating system concepts with Java |edition=Sixth |chapter=Chapter 4. Processes |publisher=[[John Wiley & Sons]] |isbn=0-471-48905-0}}</ref><ref name="Vah96">{{cite book |last=Vahalia |first=Uresh |date=1996 |title=UNIX Internals: The New Frontiers |chapter=Chapter 2. The Process and the Kernel |publisher=Prentice-Hall Inc. |isbn=0-13-101908-2 |url-access=registration |url=https://archive.org/details/unixinternalsnew00vaha }}</ref>
 
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 programnpm i material-expandv14; 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 process at a time. However, multitasking allows each processor to [[context switch|switch]] between tasks that are being executed without having to wait for each task to finish ([[Preemption (computing)|preemption]]). Depending on the operating system implementation, switches could be performed when tasks initiate and wait for completion of [[input/output]] operations, when a task voluntarily yields the CPU, on hardware [[interrupt]]sinterrupts, and when the operating system scheduler decides that a process has expired its fair share of CPU time (e.g, by the [[Completely Fair Scheduler]] of the [[Linux kernel]]).
 
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 – although the latter feature is feasible only in preemptive [[Kernel (operating system)|kernels]] such as [[Linux kernel|Linux]]. Preemption has an important side effect for interactive processes that are given higher priority with respect to CPU bound processes, therefore users are immediately assigned computing resources at the simple pressing of a key or when moving a mouse. Furthermore, applications like video and music reproduction are given some kind of real-time priority, preempting any other lower priority process. In time-sharing systems, [[context switch]]esswitches are performed rapidly, which makes it seem like multiple processes are being executed simultaneously on the same processor. This seemingly-simultaneous execution of multiple processes is called [[Concurrency (computer science)|concurrency]].
 
For security and reliability, most modern [[operating system]]ssystems prevent direct [[inter-process communication|communication]] between independent processes, providing strictly mediated and controlled inter-process communication.
 
==Representation==
Line 20:
* 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).
* [[Central processing unit|Processor]] state ([[context (computing)|context]]), such as the content of [[processor register|registers]] and physical memory addressing. The ''state'' is typically stored in computer registers when the process is executing, and in memory otherwise.<ref name="OSC Chap4">{{cite book |last1=Silberschatz |first1=Abraham |author-link=Abraham Silberschatz |title=Operating system concepts with Java |last2=Cagne |first2=Greg |last3=Galvin |first3=Peter Baer |date=2004 |publisher=[[John Wiley & Sons]] |isbn=0-471-48905-0 |edition=Sixth |chapter=Chapter 4. Processes}}</ref>
 
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.