• Loading
    • Process In Operating System



      A program in Execution is called process.

      What is the relation between process and program?

      It is same beast with different name or when this
      beast is sleeping (not executing) it is called program and when it is executing becomes process. Well, to
      be very precise. Process is not the same as program. A process is more than a program code. A process is
      an 'active' entity as oppose to program which consider to be a 'passive' entity. As we all know that a
      program is an algorithm expressed in some suitable notation, (e.g., programming language). Being a
      passive, a program is only a part of process.
      In Process model, all software on the computer is organized into a number of sequential processes. A
      process includes PC, registers, and variables. Conceptually, each process has its own virtual CPU. In
      reality, the CPU switches back and forth among processes. (The rapid switching back and forth is called

      Process State

      The process state consist of everything necessary to resume the process execution if it is somehow put
      aside temporarily. The process state consists of at least following:

      · Code for the program.

      · Program's static data.

      · Program's dynamic data.

      · Program's procedure call stack.

      · Contents of general purpose registers.

      · Contents of program counter (PC)

      · Contents of program status word (PSW).

      · Operating Systems resource in use.

      Process Operations

      Process Creation

      In general-purpose systems, some way is needed to create processes as needed during operation. There are
      four principal events led to processes creation.

      · System initialization.

      · Execution of a process Creation System calls by a running process.

      · A user request to create a new process.

      · Initialization of a batch job.

      Foreground processes interact with users. Background processes that stay in background sleeping but
      suddenly springing to life to handle activity such as email, webpage, printing, and so on. Background
      processes are called daemons. This call creates an exact clone of the calling process.

      A process may create a new process by some create process. It choose to does so, creating process is
      called parent process and the created one is called the child processes. After a process is created, both
      the parent and child have their own distinct address space. If either process changes a word in its address
      space, the change is not visible to the other process.

      Following are some reasons for creation of a process

      · User logs on.

      · User starts a program.

      · Operating systems creates process to provide service, e.g., to manage printer.

      · Some program starts another process, e.g., Netscape calls xv to display a picture.

      Process Termination

      A process terminates when it finishes executing its last statement. Its resources are returned to the system,
      it is purged from any system lists or tables, and its process control block (PCB) is erased i.e., the PCB's
      memory space is returned to a free memory pool. The new process terminates the existing process, usually
      due to following reasons:

      · Normal Exist Most processes terminates because they have done their job. This call is exist in

      · Error Exist When process discovers a fatal error. For example, a user tries to compile a program
      that does not exist.

      · Fatal Error An error caused by process due to a bug in program for example, executing an
      illegal instruction, referring non-existing memory or dividing by zero.

      · Killed by another Process A process executes a system call telling the Operating Systems to
      terminate some other process. In UNIX, this call is kill.

      Process States

      A process goes through a series of discrete process states.

      · New State The process being created.

      · Terminated State The process has finished execution.

      · Blocked (waiting) State When a process blocks, it does so because logically it cannot continue,
      typically because it is waiting for input that is not yet available. Formally, a process is said to be
      blocked if it is waiting for some event to happen (such as an I/O completion) before it can proceed.
      In this state a process is unable to run until some external event happens.

      · Running State A process is said to be running if it currently has the CPU, that is, actually using
      the CPU at that particular instant.

      · Ready State A process is said to be ready if it use a CPU if one were available. It is runnable but
      temporarily stopped to let another process run.

      Logically, the 'Running' and 'Ready' states are similar. In both cases the process is willing to run, only in
      the case of 'Ready' state, there is temporarily no CPU available for it. The 'Blocked' state is different
      from the 'Running' and 'Ready' states in that the process cannot run, even if the CPU is available.

      Process State Transitions

      Following are Six(6) possible transitions among above mentioned five (5) states:-

      · Transition 1 occurs when process discovers that it cannot continue. If running process initiates an
      I/O operation before its allotted time expires, the running process voluntarily relinquishes the CPU.

      This state transition is:

      Block (process-name): Running ? Block.

      · Transition 2 occurs when the scheduler decides that the running process has run long enough and
      it is time to let another process have CPU time.

      This state transition is:

      Time-Run-Out (process-name): Running ? Ready.

      · Transition 3 occurs when all other processes have had their share and it is time for the first
      process to run again

      This state transition is:

      Dispatch (process-name): Ready ? Running.

      · Transition 4 occurs when the external event for which a process was waiting (such as arrival of
      input) happens.

      This state transition is:

      Wakeup (process-name): Blocked ? Ready.

      · Transition 5 occurs when the process is created.

      This state transition is:

      Admitted (process-name): New ? Ready.

      · Transition 6 occurs when the process has finished execution.

      This state transition is:

      Exit (process-name): Running ? Terminated.

      Process Control Block

      A process in an operating system is represented by a data structure known as a process control block
      (PCB) or process descriptor. The PCB contains important information about the specific process

      · The current state of the process i.e., whether it is ready, running, waiting, or whatever.

      · Unique identification of the process in order to track "which is which" information.

      · A pointer to parent process.

      · Similarly, a pointer to child process (if it exists).

      · The priority of process (a part of CPU scheduling information).

      · Pointers to locate memory of processes.

      · A register save area.

      · The processor it is running on.

      The PCB is a certain store that allows the operating systems to locate key information about a process.
      Thus, the PCB is the data structure that defines a process to the operating systems.
      Comments 1 Comment
      1. Sorna's Avatar
        Sorna -
        Thanks for information.
    • Enter your email address:

      Delivered by FeedBurner

    Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.