what is process and structure of process


Process – a process will need certain resources such as CPU, memory, input/output device to accomplish its task system consist of a collection of process –
·        Operating system process executes system code
·        User process execute user code
A process contain only a single thread of control as it run
Ø  Process concept –
·        Process structure
·        Process state
·        PCB(process control block)
·        Threads

1)       Process structure –

              Process in memory
Text Section: A Process is also sometimes known as the Text Section. It also includes the current activity represented by the value of Program Counter.
Stack: Stack contains the temporary data such as function parameters, returns address and local variables.
Data Section: Contains the global variable.
Heap Section: Dynamically allocated memory to process during its run time.

Process vs program - A process is a program in execution. For example, when we write a program in C or C++ and compile it, the compiler creates a binary code. The original code and Binary code, both are programs. When we actually run the binary code, it becomes a process.
A process is an ‘active’ entity as opposed to a program which is considered to be a ‘passive’ entity. A single program can create many processes when run multiple times, for example when we open a .exe or binary file multiple times, many instances begin (many processes are created).

                         Process
                        Program
A process is an active activity.
A program is an passive activity
A program becomes a process when it is in execution mode.
A program containing a list of instruction stored on disk.