Actions

Multitasking and process management::Process (computing)

::concepts

Process::system    Computer::program    Memory::process    State::states    Which::science    Multiple::first

Multitasking and process management {{#invoke:main|main}}

A multitasking operating system may just switch between processes to give the appearance of many processes executing simultaneously (that is, in parallel), though in fact only one process can be executing at any one time on a single-core CPU (unless using multithreading or other similar technology).Unknown extension tag "ref"

It is usual to associate a single process with a main program, and 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. However, 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".Unknown extension tag "ref"

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, 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 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.

Process states

{{#invoke:main|main}}

The various process states, displayed in a state diagram, with arrows indicating possible transitions between states.

An operating system kernel that allows multitasking needs processes to have certain states. Names for these states are not standardised, but they have similar functionality.<ref name="OSC Chap4"/>

  • First, the process is "created" by being loaded from a secondary storage device (hard disk drive, CD-ROM, etc.) into main memory. After that the process scheduler assigns it the "waiting" state.
  • While the process is "waiting", it waits for the scheduler to do a so-called context switch and load the process into the processor. The process state then becomes "running", and the processor executes the process instructions.
  • If a process needs to wait for a resource (wait for user input or file to open, for example), it is assigned the "blocked" state. The process state is changed back to "waiting" when the process no longer needs to wait.
  • Once the process finishes execution, or is terminated by the operating system, it is no longer needed. The process is removed instantly or is moved to the "terminated" state. When removed, it just waits to be removed from main memory.<ref name="OSC Chap4" /><ref name="Stallings">{{#invoke:citation/CS1|citation

|CitationClass=book }} (particularly chapter 3, section 3.2, "process states", including figure 3.9 "process state transition with suspend states")</ref>


Process (computing) sections
Intro  Representation  Multitasking and process management  Inter-process communication  History  See also  Notes  References  Further reading  External links  

Multitasking and process management
PREVIOUS: RepresentationNEXT: Inter-process communication
<<>>