Process (computing)

From Free net encyclopedia

In computing, a process is a running instance of a program, including all variables and other state. A multitasking operating system may just switch between processes to give the appearance of many processes executing concurrently or simultaneously, though in fact only one process can be executing at any one time per CPU thread.

A multitasking operating system switches between processes to give the appearance of simultaneous execution, though in fact, in general, only one process can be executing per CPU core.

Some new processors, such as Athlon_64_X2 can actually execute two processes at a time,because they are multicore processors.

Intel's Pentium 4 with Hyperthreading capability have a different design,some doubled parts of the core allow the processor to make a context switch in almost no time

It is usual to associate a single process with a main program, and 'daughter' 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 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.

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 or thrashing). The operating system may also provide mechanisms for inter-process communication to enable processes to interact in safe and predictable ways.

In general, a computer system process consists of (or is said to 'own') the following resources:

  • An image of the executable computer code associated with a program.
  • Memory, (typically some region of virtual memory and/or real memory) which contains the executable code and process-specific data, including initial, intermediary, and final products.
  • Operating system descriptors of resources that are allocated to the process, such as file descriptors (Unix terminology) or handles (Windows).
  • Security attributes, such as the process owner and the process' set of permissions.
  • Processor state (context), such as the content of registers, physical memory addressing, etc. The state is typically stored in computer registers when the process is executing, and in memory otherwise.

Any subset of resources, but typically at least the processor state, may be associated with each of the process' threads in operating systems that support threads or 'daughter' processes.

If a task/process is suspended, then it is eligible for swapping to disk, but this is transparent in a virtual memory system, where blocks of memory values may be really on disk and not in physical 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. However, if the process attempts to access code or data on disk, then it will be suspended while that content is moved into physical memory through a process known as paging.

History

Once computer control software had evolved from Monitor control software, e.g., IBSYS, to Executive control software (by the early '60s, see History of operating systems), it was possible to do multiprogramming. Multiprogramming is a rudimentary form of multiprocessing in which several programs are run "at the same time" (i.e., concurrrently) 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. Threads came somewhat later. However, with the advent of time-sharing; computer networks; multiple-CPU, shared memory computers; etc., the old "multiprogramming" gave way to true multitasking, multiprocessing and, later, multithreading.

See also

fr:processus no:Prosess (informatikk) ja:プロセス pl:Proces (informatyka) sv:Process (dator) sk:Proces (informatika) zh:进程 es:Proceso_(informática)