Process-A State Where Program Is Executing || Club5050

in Zero to Infinity2 years ago


losa.jpg

I made it using illustrator

Process defines a program which is executing. For example, when we write a code on any higher-level language and then compile it. The original code and compiled binary code both are a program, but when we actually run it on a computer, then that program is called a process. For this reason, a process is known as an active entity, but a program is known as a passive entity. A single program can create multiple process while it running on different times.

A process looks like in memory as below:


circuit-board-ge73646bdd_640.png

I took this picture from the net.Here, is Source

Text section:A process is sometimes representing as a text section. The current activity is also included by text section. Program counter represent the value of it.
Stack: it contains temporary data. Like local variables.
Data section: Global variable is contained by data section.
Heap section: During its run time to process dynamically allocated memory.

Attributes or characteristics of process

  • Process ID: Each process ID is unique, given by the operating system.
  • Process state: New, Ready, Run etc.
  • CPU registers: Like Program counter
  • Accounts information
  • I/O status information: For example, open files, devices allocated to the process etc.
  • CPU scheduling information: For example, priority.

States of process

From the creation till terminating, a process passes through various states. It has many states, but at least a process has to pass through four states for terminating it. Let’s discuss about different states of a process.


dftiojh.jpg

I made it using Illustrator

  • New: A process which is going to be picked up by an operating system is called a new process.

  • Ready: As soon as the process is created, it enters into the ready state directly. Here on that state, a process is waiting for CPU to be assigned. There can be more than one program in ready state. Those processes are presented on the main memory.

  • Running: From the ready state, one of the processes will be chosen to use CPU scheduling algorithm by operating system. On running state, a process starts executing.

  • Block or wait: From running state, a process can go to the block or wait state, depending upon the scheduling algorithm. When a process waits for a certain resource on that waiting time CPU will not be ideal, but it put the process on block state and start a new process.

  • Completion or Termination: When a process finishes its execution, then it comes in the completion state. All the Context of the process will be deleted here, and the operating system will terminate the process.

  • Suspend ready: A process which is present in the ready state but at a time it moves from the main memory to the secondary memory due to the lack of resources is called suspend ready state. It happens when the main memory is full and a higher priority process comes to the ready state. It remains on the secondary memory and as soon as the main memory will be free then it came back to the main memory.

  • Suspend wait: It is better to remove the wait or block state process instead of removing the process which are in ready state. As a result, higher priority process get room in main memory.

Operation on the process

  • Creation
  • Scheduling
  • Execution
  • Deletion or killing

Conclusion

Process is the most important factor in computer. Because every program we use in a computer or every video we watch or every song we heard is a process. So, it is important to maintain those processes carefully.

Source

  1. Operating Systems
  1. Operating Systems

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 65697.93
ETH 3342.39
USDT 1.00
SBD 2.63