Actions

Difference between revisions of "Process"

Line 1: Line 1:
A series of systematic sequence of steps or actions that result in a [[deliverable]]. A '''process''' consumes resources aka "input" and produces a deliverable aka "[[output]]."  
+
'''Process''' is a series of systematic sequence of steps or actions that result in a [[deliverable]]. A process consumes resources aka "input" and produces a deliverable aka "[[output]]."  
 
*Each step can be called a stage, phase, or procedure
 
*Each step can be called a stage, phase, or procedure
 
*Changing the sequence of steps will result in a different deliverable
 
*Changing the sequence of steps will result in a different deliverable

Revision as of 16:22, 6 April 2021

Process is a series of systematic sequence of steps or actions that result in a deliverable. A process consumes resources aka "input" and produces a deliverable aka "output."

  • Each step can be called a stage, phase, or procedure
  • Changing the sequence of steps will result in a different deliverable
  • Steps can execute in parallel

The two important things in a process are: steps, and deliverable. A step itself is a series of actions that produces a deliverable which is used by the next step in a process. A deliverable is "something" of value - a component part, piece of software, tool, template etc. The boundaries of a process, therefore, are arbitrary - where one draws a line can be driven by factors such as time, and organizational unit.[1]


Definition of Process[2]

A process may refer to any of the following:

  • 1. A process or running process refers to a set of instructions currently being processed by the computer processor.

For example, in Windows you can see each of the processes running by opening the Processes tab in Task Manager. Windows Processes are Windows Services and background programs you normally don't see running on the computer. A process may be a printer program that runs in the background and monitors the ink levels and other printer settings while the computer is running. A typical computer has dozens of processes running all of the time to help manage the operating system, its hardware, and the software running on the computer.

  • 2. Process is also the act of manipulating, altering, or viewing data.
  • 3. In general, process refers to a set of predetermined rules in place that must be followed.

A process is basically a program in execution. The execution of a process must progress in a sequential fashion. A process is defined as an entity which represents the basic unit of work to be implemented in the system. To put it in simple terms, we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program. When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text and data. The following image shows a simplified layout of a process inside main memory −

Simplified layout of a process inside main memory
source: Tutorialspoint


Process in Operating Systems[3]

In UNIX and some other operating systems, a process is started when a program is initiated (either by a user entering a shell command or by another program). Like a task, a process is a running program with which a particular set of data is associated so that the process can be kept track of. An application that is being shared by multiple users will generally have one process at some stage of execution for each user. A process can initiate a subprocess, which is a called a child process (and the initiating process is sometimes referred to as its parent ). A child process is a replica of the parent process and shares some of its resources, but cannot exist if the parent is terminated. Processes can exchange information or synchronize their operation through several methods of interprocess communication ( IPC ).

Since most operating systems have many background tasks running, your computer is likely to have many more processes running than actual programs. This can be anything from a small background task, such as a spell-checker or system events handler to a full-blown application like Internet Explorer or Microsoft Word. For example, you may only have three programs running, but there may be twenty active processes. You can view active processes in Windows by opening the Task Manager (press Ctrl-Alt-Delete and click Task Manager). On a Mac, you can see active processes by opening Activity Monitor (in the Applications→Utilities folder). The term "process" can also be used as a verb, which means to perform a series of operations on a set of data. For example, your computer's CPU processes information sent to it by various programs. All processes are composed of one or more threads.[4]


Process and Threads[5]

PROCESSES and threads have one goal: Getting a computer to do more than one thing at a time. To do that, the processor (or processors) must switch smoothly among several tasks, which requires application programs designed to share the computer's resources.

That is why programmers need to split what programs do into processes and threads.

Every program running on a computer uses at least one process. That process consists of an address space (the part of the computer's memory where the program is running) and a flow of control (a way to know which part of the program the processor is running at any instant). In other words, a process is a place to work and a way to keep track of what a program is doing. When several programs are running at the same time, each has its own address space and flow of control.

To serve multiple users, a process may need to fork, or make a copy of itself, to create a child process. Like its parent process, the child process has its own address space and flow of control. Usually, however, when a parent process is terminated, all of the child processes it has launched will also be killed automatically.

All that time adds up when many programs are running at once or when many users each require several processes running at the same time. The more processes running, the greater the percentage of time the CPU and operating system will spend doing expensive context switches. With enough processes to run, a server might eventually spend almost all of its time switching among processes and never do any real work.

To avoid that problem, programmers can use threads. A thread is like a child process, except all the threads associated with a given process share the same address space. For example, when there are many users for the same program, a programmer can write the application so that a new thread is created for each user. Each thread has its own flow of control, but it shares the same address space and most data with all other threads running in the same process. As far as each user can tell, the program appears to be running just for him.

The advantage? It takes much less CPU time to switch among threads than between processes, because there's no need to switch address spaces. In addition, because they share address space, threads in a process can communicate more easily with one another.

If the program is running on a computer with multiple processors, a single-process program can be run by only one CPU, while a threaded program can divide the threads up among all available processors. So moving a threaded program to a multiprocessor server should make it run faster.

The downside? Programs using threads are harder to write and debug. Not all programming libraries are designed for use with threads. And not all legacy applications work well with threaded applications. Some programming tools also make it harder to design and test threaded code.


Process State[6]

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. The following typical process states are possible on computer systems of all kinds. In most of these states, processes are "stored" on main memory. The figure below shows the various process states, displayed in a state diagram, with arrows indicating possible transitions between states - as can be seen some processes are stored in main memory (yellow), and some are stored in secondary memory (green).

The various process states, displayed in a state diagram,

  • Created: When a process is first created, it occupies the "created" or "new" state. In this state, the process awaits admission to the "ready" state. Admission will be approved or delayed by a long-term, or admission, scheduler. Typically in most desktop computer systems, this admission will be approved automatically. However, for real-time operating systems this admission may be delayed. In a realtime system, admitting too many processes to the "ready" state may lead to oversaturation and overcontention of the system's resources, leading to an inability to meet process deadlines.
  • Ready: A "ready" or "waiting" process has been loaded into main memory and is awaiting execution on a CPU (to be context switched onto the CPU by the dispatcher, or short-term scheduler). There may be many "ready" processes at any one point of the system's execution—for example, in a one-processor system, only one process can be executing at any one time, and all other "concurrently executing" processes will be waiting for execution. A ready queue or run queue is used in computer scheduling. Modern computers are capable of running many different programs or processes at the same time. However, the CPU is only capable of handling one process at a time. Processes that are ready for the CPU are kept in a queue for "ready" processes. Other processes that are waiting for an event to occur, such as loading information from a hard drive or waiting on an internet connection, are not in the ready queue.
  • Running: A process moves into the running state when it is chosen for execution. The process's instructions are executed by one of the CPUs (or cores) of the system. There is at most one running process per CPU or core. A process can run in either of the two modes, namely kernel mode or user mode.
  • Kernel mode:
    • Processes in kernel mode can access both: kernel and user addresses.
    • Kernel mode allows unrestricted access to hardware including execution of privileged instructions.
    • Various instructions (such as I/O instructions and halt instructions) are privileged and can be executed only in kernel mode.
    • A system call from a user program leads to a switch to kernel mode.
  • User mode:
    • Processes in user mode can access their own instructions and data but not kernel instructions and data (or those of other processes).
    • When the computer system is executing on behalf of a user application, the system is in user mode. However, when a user application requests a service from the operating system (via a system call), the system must transition from user to kernel mode to fulfill the request.
    • User mode avoids various catastrophic failures:
      • There is an isolated virtual address space for each process in user mode.
      • User mode ensures isolated execution of each process so that it does not affect other processes as such.
      • No direct access to any hardware device is allowed.
  • Blocked: A process transitions to a blocked state when it cannot carry on without an external change in state or event occurring. For example, a process may block on a call to an I/O device such as a printer, if the printer is not available. Processes also commonly block when they require user input, or require access to a critical section which must be executed atomically. Such critical sections are protected using a synchronization object such as a semaphore or mutex.
  • Terminated: A process may be terminated, either from the "running" state by completing its execution or by explicitly being killed. In either of these cases, the process moves to the "terminated" state. The underlying program is no longer executing, but the process remains in the process table as a zombie process until its parent process calls the wait system call to read its exit status, at which point the process is removed from the process table, finally ending the process's lifetime. If the parent fails to call wait, this continues to consume the process table entry (concretely the process identifier or PID), and causes a resource leak.

Additional Process States
Two additional states are available for processes in systems that support virtual memory. In both of these states, processes are "stored" on secondary memory (typically a hard disk).

  • Swapped out and waiting: (Also called suspended and waiting.) In systems that support virtual memory, a process may be swapped out, that is, removed from main memory and placed on external storage by the scheduler. From here the process may be swapped back into the waiting state.
  • Swapped out and blocked: (Also called suspended and blocked.) Processes that are blocked may also be swapped out. In this event the process is both swapped out and blocked, and may be swapped back in again under the same circumstances as a swapped out and waiting process (although in this case, the process will move to the blocked state, and may still be waiting for a resource to become available).


See Also

Process AnalysisV Process Analytics
Process Architecture
Process Capability
Process Capability Assessment Model (PCAT)
Process Classification Framework (PCF)
Process Control
Process Decision Program Chart
Process Hierarchy Diagram
Process Integration
Process Mapping
Process Mining
Process Model
Process Optimization
Mainframe
Operating System (OS)
Central Processing Unit (CPU)
Computer Networking
Computer Program
Computer-Aided Process Planning (CAPP)


References

  1. What is Process? CIO Index
  2. Definition - What does Process Mean? Computer Hope
  3. Process in Operating Systems Techtarget
  4. Understanding Processes on Operating Systems Techterms
  5. Process and Threads Computer World
  6. Process State Wikipedia