Processes in Operating System

The most fundamental concept of any operating system is process. A process is a representation of a running program.

A process is an executing program that includes the current program counter, registers, and variables.

Almost all computers today can perform multiple tasks at the same time. For example, you can download files from the Internet, use your Facebook account, and copy some songs to a pen drive all at the same time. This is known as multitasking.

Because I'm using Windows, here's a screenshot of the task manager, which displays the processes that are currently running on my machine. For your convenience, I took and included this photograph.

process task manager snapshot

If you are using a Windows system, you can open the "Task Manager" window by pressing "Alt+Ctrl+Del" and then clicking on "Task Manager." Another option is to simply click on the "window" key, then type "Task Manager" and press the "enter" key.

Here is a list of the topics we will be discussing.

The first two topics, "Process Model" and "Process Creation," will be discussed in the following two posts, and the remaining five topics will be discussed in this article, beginning with the next heading and paragraphs.

Process Termination in Operating System

When a process is created, it begins to run and completes its tasks. The new process will generally terminate due to one of the conditions listed below.

  • Normal exit: Processes terminate normally because they have completed their tasks successfully.
  • Error exit: In error exit, a process is terminated due to an error caused by the process, sometimes due to a program bug.
  • Fatal exit: A fatal exit occurs when a process detects a fatal error.
  • Killed by other process: In this case, a process may also terminate because it executes a system call instructing the operating system to simply kill another process.

A process that is terminated due to a "fatal error" may be harmful because it may lose data or other unsaved items.

Process Hierarchies in Operating System

When one process creates another in some computer systems, the parent and child processes are still associated in certain ways. The child process can generate more processes, forming a process hierarchy.

A process group in a Unix system is made up of a process and all of its children and descendants.

When a computer user sends a signal from the keyboard, that signal is delivered to all process group members who are currently associated with the keyboard.

Windows systems have no concept of a process hierarchy, so each process can catch the signal, ignore the signal, or take the default action.

Process States in Operating System

Because each process is an independent entity with its own program counter and internal state, processes must occasionally interact with one another. A process may occasionally generate output that is used as input by another process.

The diagram below depicts all three states.

process state

Process Implementation in Operating System

The operating system keeps a table with one entry for each process to implement the process model. This table is known as a process table.

The entry contains information about the process's state, its program counter, stack pointer, memory allocation, the status of its open files, accounting and scheduling information, and everything else about the process that must be saved when the process is switched from running to ready or blocked state, so it can be restarted later as if it had never been stopped.

Interprocess Communication in Operating System

Processes that are working together in different OSs (Operating Systems) may share some common storage that each one can read and write to.

The shared storage could be in main memory or a shared file; the location of the shared memory has no bearing on the nature of the communication or the problems that may arise.

Consider a simple print spooler to understand how Interprocess Communication works. When a process wishes to print a file, it places it in a special spooler directory. Another process, the printer daemon, checks to see if there are any files to be printed and, if so, prints them and removes their names from the directory.

Operating System Online Test


« Previous Topic Next Topic »

Follow/Like Us on Facebook




Subscribe Us on YouTube