All Topics  
Process (computing)

 

   Email Print
   Bookmark   Link






 

Process (computing)



 
 
In computing, a process is an instance
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
 of a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently
Concurrency (computer science)

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other....
.

A computer program itself is just a passive collection of instructions, while a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed.






Discussion
Ask a question about 'Process (computing)'
Start a new discussion about 'Process (computing)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computing, a process is an instance
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
 of a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently
Concurrency (computer science)

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other....
.

A computer program itself is just a passive collection of instructions, while a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed. In the computing world, processes are formally defined by the operating system(s)(OS) running them and so may differ in detail from one OS to another.

A single computer processor
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 executes one or more (multiple) instructions at a time (per clock cycle), one after the other (this is a simplification; for the full story, see superscalar CPU architecture
Superscalar

A superscalar Central processing unit architecture implements a form of parallel computer called instruction level parallelism within a single processor....
). To allow users to run several programs at once (e.g., so that processor time is not wasted waiting for input from a resource), single-processor computer systems can perform time-sharing
Time-sharing

Time-sharing refers to sharing a computing resource among many users by Computer multitasking. Its introduction in the 1960s, and emergence as the prominent model of computing in the 1970s, represents a major historical shift in the history of computing....
. Time-sharing allows processes to switch
Context switch

A context switch is the computing process of storing and restoring the State of a Central processing unit such that multiple Process es can share a single CPU resource....
 between being executed and waiting (to continue) to be executed. In most cases this is done very rapidly, providing the illusion that several processes are executing 'at once'. (This is known as concurrency
Concurrency (computer science)

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other....
 or multiprogramming.) Using more than one physical processor
Multiprocessing

Multiprocessing is the use of two or more CPU within a single computer system. The term also refers to the ability of a system to support more than one processor and/or the ability to allocate tasks between them....
 on a computer, permits true simultaneous execution of more than one stream of instructions from different processes, but time-sharing is still typically used to allow more than one process to run at a time. (Concurrency is the term generally used to refer to several independent processes sharing a single processor; simultaneously is used to refer to several processes, each with their own processor.) Different processes may share the same set of instructions in memory (to save storage), but this is not known to any one process. Each execution of the same set of instructions is known as an instance— a completely separate instantiation
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
 of the program.

For security and reliability reasons most modern operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
s prevent direct communication
Inter-process communication

Inter-Process Communication is a set of techniques for the exchange of data among multiple thread in one or more Process . Processes may be running on one or more computers connected by a computer network....
 between 'independent' processes, providing strictly mediated and controlled inter-process communication functionality.

Sub-processes and multi-threading


A process may split itself into multiple 'daughter' sub-processes or threads that execute in parallel, running different instructions on much of the same resources and data (or, as noted, the same instructions on logically different resources and data).

Multithreading is useful when various 'events' are occurring in an unpredictable order, and should be processed in another order than they occur, for example based on response time constraints. Multithreading makes it possible for the processing of one event to be temporarily interrupted by an event of higher priority. Multithreading may result in more efficient CPU time utilization, since the CPU may switch to low-priority tasks while waiting for other events to occur.

For example, a word processor
Word processor

A word processor is a computer Application software used for the production of any sort of printable material.Word processor may also refer to an obsolete type of stand-alone office machine, popular in the 1970s and 80s, combining the keyboard text-entry and printing functions of an electric typewriter with a dedicated computer for th...
 could perform a spell check as the user types, without "freezing" the application - a high-priority thread could handle user input and update the display, while a low-priority background process runs the time-consuming spell checking utility. This results in that the entered text is shown immediately on the screen, while spelling mistakes are indicated or corrected after a longer time.

Multithreading allows a server
Server (computing)

A server is a computer program that provides services to other computer programs , in the same or other computer. The physical computer that runs a server program is also often referred to as server....
, such as a web server
Web server

The term web server can mean one of two things:# A computer program that is responsible for accepting Hypertext Transfer Protocol requests from clients , and Server them HTTP responses along with optional data contents, which usually are web pages such as Hypertext Markup Language documents and linked objects ....
, to serve requests from several users concurrently. Thus, we can avoid that requests are left unheard if the server is busy with processing a request. One simple solution to that problem is one thread that puts every incoming request in a queue, and a second thread that processes the requests one by one in a first-come first-served manner. However, if the processing time is very long for some requests (such as large file requests or requests from users with slow network access data rate), this approach would result in long response time also for requests that do not require long processing time, since they may have to wait in queue. One thread per request would reduce the response time substantially for many users and may reduce the CPU idle time and increase the utilization of CPU and network capacity. In case the communication protocol between the client and server is a communication session involving a sequence of several messages and responses in each direction (which is the case in the TCP
Transmission Control Protocol

The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is so central that the entire suite is often referred to as "TCP/IP"....
 transport protocol used in for web browsing), creating one thread per communication session would reduce the complexity of the program substantially, since each thread is an instance
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
 with its own state and variables.

In a similar fashion, multi-threading would make it possible for a client
Client (computing)

A client is an Application software or system that accesses a remote service on another computer system, known as a Server , by way of a Computer network....
 such as a web browser to communicate efficiently with several servers concurrently.

A process that has only one thread is referred to as a single-threaded process, while a process with multiple threads is referred to as a multi-threaded process. Multi-threaded processes have the advantage over multi-process systems that they can perform several tasks concurrently without the extra overhead needed to create a new process and handle synchronised communication between these processes. However, single-threaded processes have the advantage of even lower overhead.

Representation

In general, a computer system process consists of (or is said to 'own') the following resources:
  • An image of the executable machine code
    Machine code

    Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit. Machine code may be regarded as a primitive programming language or as the lowest-level representation of a compiled and/or assembly language computer program....
     associated with a program.
  • Memory (typically some region of virtual memory
    Virtual memory

    Virtual memory is a computer system technique which gives an application program the impression that it has contiguous working memory , while in fact it may be physically fragmented and may even overflow on to disk storage....
    ); which includes the executable code, process-specific data (input and output), a call stack
    Call stack

    In computer science, a call stack is a dynamic Stack data structure that stores information about the active subroutines of a computer program....
     (to keep track of active subroutines and/or other events), and a heap
    Dynamic memory allocation

    In computer science, dynamic memory allocation is the allocation of computer storage storage for use in a computer program during the runtime of that program....
     to hold intermediate computation data generated during run time.
  • Operating system descriptors of resources that are allocated to the process, such as file
    Computer file

    A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
     descriptors (Unix
    Unix

    Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
     terminology) or handles
    Handle (computing)

    A handle is a particular kind of smart pointer. Handles are used when an application references blocks of memory or objects managed by another system, such as a database or an operating system....
     (Windows
    Microsoft Windows

    Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
    ), and data sources and sinks.
  • Security
    Computer security

    Computer security is a branch of technology known as information security as applied to computers. The objective of computer security can include protection of information from theft or corruption, or the preservation of availability, as defined in the security policy....
     attributes, such as the process owner and the process' set of permissions (allowable operations).
  • Processor
    Central processing unit

    A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
     state (context), such as the content of registers
    Processor register

    In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere....
    , physical memory addressing, etc. The state is typically stored in computer registers when the process is executing, and in memory otherwise.


The operating system holds most of this information about active processes in data structures called process control block
Process control block

A Process Control Block is a data structure in the operating system Kernel containing the information needed to manage a particular process. The PCB is "the manifestation of a process in an operating system"....
s (PCB).

Any subset of resources, but typically at least the processor state, may be associated with each of the process' threads
Thread (computer science)

In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
 in operating systems that support threads or 'daughter' processes.

The operating system keeps its processes separated and allocates the resources they need so that they are less likely to interfere with each other and cause system failures (e.g., deadlock
Deadlock

A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does. It is often seen in a paradox like 'the chicken or the egg'....
 or thrashing
Thrash (computer science)

In computer science, thrash , is the term used to describe a degenerate situation on a computer where increasing resources are used to do a decreasing amount of work....
). The operating system may also provide mechanisms for inter-process communication
Inter-process communication

Inter-Process Communication is a set of techniques for the exchange of data among multiple thread in one or more Process . Processes may be running on one or more computers connected by a computer network....
 to enable processes to interact in safe and predictable ways.

Process management in multi-tasking operating systems


A multitasking
Computer multitasking

In computing, multitasking is a method by which multiple tasks, also known as Computer process, share common processing resources such as a Central processing unit....
* operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
 may just switch between processes to give the appearance of many processes executing
Execution (computers)

Execution in computer engineering and software engineering is the Process by which a computer or a virtual machine carries out the instructions of a computer program....
 concurrently
Concurrency (computer science)

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other....
 or simultaneously, though in fact only one process can be executing at any one time on a single-core CPU
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 (unless using multi-threading or other similar technology).

It is usual to associate a single process with a main program, and 'daughter' ('child') processes with any spin-off, parallel processes, which behave like asynchronous subroutines. A process is said to own resources, of which an image of its program (in memory) is one such resource. (Note, however, that in multiprocessing systems, many processes may run off of, or share, the same reentrant program at the same location in memory— but each process is said to own its own image of the program.)

Processes are often called tasks in embedded
Embedded system

An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints....
 operating systems. The sense of 'process' (or task) is 'something that takes up time', as opposed to 'memory', which is 'something that takes up space'. (Historically, the terms 'task' and 'process' were used interchangeably, but the term 'task' seems to be dropping from the computer lexicon.)

The above description applies to both processes managed by an operating system, and processes as defined by process calculi.

If a process requests something for which it must wait, it will be blocked. When the process is in the Blocked State
Process states

In a computer multitasking computer system, process may occupy a variety of state . These distinct states may not actually be recognized as such by the operating system kernel , however they are a useful abstraction for the understanding of processes....
, it is eligible for swapping to disk, but this is transparent in a virtual memory
Virtual memory

Virtual memory is a computer system technique which gives an application program the impression that it has contiguous working memory , while in fact it may be physically fragmented and may even overflow on to disk storage....
 system, where blocks of memory values may be really on disk and not in main memory at any time. Note that even unused portions of active processes/tasks (executing programs) are eligible for swapping to disk. All parts of an executing program and its data do not have to be in physical memory for the associated process to be active.

______________________________

*Tasks and processes refer essentially to the same entity. And, although they have somewhat different terminological histories, they have come to be used as synonyms. Today, the term process is generally preferred over task, except when referring to 'multitasking', since the alternative term, 'multiprocessing', is too easy to confuse with multiprocessor (which is a computer with two or more CPUs).

Process states

Process States
Processes go through various process states
Process states

In a computer multitasking computer system, process may occupy a variety of state . These distinct states may not actually be recognized as such by the operating system kernel , however they are a useful abstraction for the understanding of processes....
 which determine how the process is handled by the operating system kernel. The specific implementations of these states vary in different operating systems, and the names of these states are not standardised, but the general high-level functionality is the same.

When a process is created, it needs to wait for the process scheduler
Scheduling (computing)

Scheduling is a key concept in computer multitasking and multiprocessing operating system design, and in real-time operating system design. In modern operating systems, there are typically many more processes running than there are CPUs available to run them....
 (of the operating system) to set its status to "waiting" and load it into main memory from secondary storage device (such as a hard disk
Hard disk

A hard disk drive , commonly referred to as a hard drive, hard disk, or fixed disk drive, is a non-volatile storage device which stores digitally encoded data on rapidly rotating hard disk platters with magnetic surfaces....
 or a CD-ROM
CD-ROM

CD-ROM is a pre-pressed Compact Disc that contains Computer data storage accessible to, but not writable by, a computer. While the Compact Disc format was originally designed for music storage and playback, the 1985 Yellow Book standard developed by Sony and Philips adapted the format to hold any form of Binary file....
). Once the process has been assigned to a processor by a short-term scheduler
Scheduling (computing)

Scheduling is a key concept in computer multitasking and multiprocessing operating system design, and in real-time operating system design. In modern operating systems, there are typically many more processes running than there are CPUs available to run them....
, a context switch
Context switch

A context switch is the computing process of storing and restoring the State of a Central processing unit such that multiple Process es can share a single CPU resource....
 is performed (loading the process into the processor) and the process state is set to "running" - where the processor executes its instructions. If a process needs to wait for a resource (such as waiting for user input, or waiting for a file to become available), it is moved into the "blocked" state until it no longer needs to wait - then it is moved back into the "waiting" state. Once the process finishes execution, or is terminated by the operating system, it is moved to the "terminated" state where it waits to be removed from main memory.

Inter-process communication

Processes can communicate with each other via Inter-process communication (IPC). This is possible for both processes running on the same machine and on different machines. The subject is a difficult one to discuss concisely, because it differs considerably from one operating system (OS) to another. However, a useful way to approach it is to consider the general mechanisms used in one form or another by most OS and to recognize that any given OS will only employ some subset of that universe.

History

By the early 60s computer control software had evolved from Monitor control software, e.g., IBSYS
IBSYS

IBSYS was the magnetic tape#Magnetic tape data storage based operating system that IBM supplied with its IBM 7090 and IBM 7094 computers. A similar operating system , also called IBSYS, was provided with IBM 7040 and IBM 7044 computers....
, to Executive control software, making it possible to do multiprogramming. Multiprogramming is a rudimentary form of multiprocessing
Multiprocessing

Multiprocessing is the use of two or more CPU within a single computer system. The term also refers to the ability of a system to support more than one processor and/or the ability to allocate tasks between them....
 in which several programs are run "at the same time" (i.e., concurrently
Concurrency (computer science)

In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other....
) on a single uniprocessor. That is, several programs are allowed to share the CPU- a scarce resource. Since there was only one processor, there was no true simultaneous execution of different programs. Instead, the later computer 'monitor-type' control software (known by then also as 'Executive' systems), and early "operating systems," typically allowed execution of part of one program until it was halted by some missing resource (e.g., input), or until some slow operation (e.g., output) had completed. At that point, a second (or nth) program was started or restarted. To the user it appeared that all programs were executing "at the same time" (hence the term, concurrent).

Shortly thereafter, the notion of a 'program' was expanded to the notion of an 'executing program and its context,' i.e., the concept of a process was born. This became necessary with the invention of re-entrant code. Thread
Thread (computer science)

In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
s came somewhat later. However, with the advent of time-sharing
Time-sharing

Time-sharing refers to sharing a computing resource among many users by Computer multitasking. Its introduction in the 1960s, and emergence as the prominent model of computing in the 1970s, represents a major historical shift in the history of computing....
; computer networks; multiple-CPU, shared memory
Shared memory

In computing, shared memory is a memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies....
 computers; etc., the old "multiprogramming" gave way to true multitasking
Computer multitasking

In computing, multitasking is a method by which multiple tasks, also known as Computer process, share common processing resources such as a Central processing unit....
, multiprocessing and, later, multithreading.

See also


  • Child process
    Child process

    A child process is a computer process created by another process .A child process inherits most of its attributes, such as open computer files, from its parent....
  • Exit
    Exit (operating system)

    A computer process terminates its execution by making an exit system call. More generally, an exit in a multithreading environment means that a thread of execution has stopped running....
  • Fork
    Fork (operating system)

    In computing, when a Computer_process forks, it creates a copy of itself, which is called a "Child_process." The original process is then called the "Parent_process"....
  • Orphan process
    Orphan process

    An Orphan process is a process whose parent process has finished or exit .A process can become orphaned during remote invocation when the client process crashes after making a request of the server....
  • Parent process
    Parent process

    A parent process is a computer process that has created one or more child processes.In Unix, every process except process 0 is created when another process executes the fork system call....
  • Process group
    Process group

    In POSIX-conformant operating systems, a process group denotes a collection of one or more process es. Process groups are used to control the distribution of signal s....
  • Process states
    Process states

    In a computer multitasking computer system, process may occupy a variety of state . These distinct states may not actually be recognized as such by the operating system kernel , however they are a useful abstraction for the understanding of processes....
  • Task
    Task (computers)

    A task is "an execution path through address space". In other words, a set of Computer program instruction s that are loaded in computer storage....
  • Thread
    Thread (computer science)

    In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
  • Wait
    Wait (operating system)

    In modern computer operating systems, a process may wait on another process to complete its execution. In most systems, a parent process can create an independently executing child process....
  • Zombie process
    Zombie process

    On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has exit but still has an entry in the process table....
  • Process management (computing)
    Process management (computing)

    Process management is an integral part of any modern day operating system . The OS must allocate resources to process , enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronisation among processes....


External links

  • - Your guide to the inside.