Author

Author- Ram Ranjeet Kumar

PAGE 3

Lecture- 05 Process in Operating System

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 −
  • The Text section is made up of the compiled program code, read in from non-volatile storage when the program is launched.
  • The Data section is made up the global and static variables, allocated and initialized prior to executing the main.
  • The Heap is used for the dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc.
  • The Stack is used for local variables. Space on the stack is reserved for local variables when they are declared.

No comments:

Post a Comment