0% found this document useful (0 votes)
19 views3 pages

Process Is A Program in Execution

A process consists of a program code section, current activity including registers and program counter, a stack, data section, and heap. A process can contain one or more threads, which are the basic units of CPU utilization and consist of a program counter, register set, and stack. Context switching allows the system to pause the current job by saving its context and loading the context of a new job, enabling the handling of interrupts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Process Is A Program in Execution

A process consists of a program code section, current activity including registers and program counter, a stack, data section, and heap. A process can contain one or more threads, which are the basic units of CPU utilization and consist of a program counter, register set, and stack. Context switching allows the system to pause the current job by saving its context and loading the context of a new job, enabling the handling of interrupts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

· Process is a program in execution

·Process ≠ program
· The program is only part of a process;
· One program can be several processes
· Components of a process
· The program code also called text section
· Current activity including : program counter, processor registers
· Stack containing temporary data
· Function parameters, return addresses, local variables
· Data section containing global variables
· Heap :- a memory that is dynamically allocated during run time

Thread
· Thread is a basic unit of CPU utilization;
· Belongs to a process
· Is a flow of control within a process
· consists of a program counter (PC), a register set, and a stack
· A process can have a single or multiple thread
Basic idea of Thread
· We build virtual processors in software, on top of physical processors:
 Processor: Provides a set of instructions along with the capability of
automatically executing a series of those instructions.
 Thread: A minimal software processor in whose context a series of instructions
can be executed.
Saving a thread context implies stopping the current execution and saving all the
data needed to continue the execution at a later stage.
 Process: A software processor in whose context one or more threads may be
executed.
Executing a thread, means executing a series of instructions in the context of that
thread.

Context Switching

· A technique used for pausing what the system is doing and taking on another “possibly” urgent job.
·Save the context of the current job so that it can resume back from where it has left off ·

Load the context ofthe new job

· Context switching is an overhead

· Processor context:The minimal collection of values stored in the registers of aprocessor used for the
execution of aseries of instructions (e.g., stack pointer, addressing registers, program counter).

· Allows to handle interrupt and resume back later on

· Thread context:The minimal collection of values stored in registers and memory, used for the
execution of a series of instructions (i.e., processor context,state).
· Process context:The minimal collection of values stored in registers and memory, used for the
execution of a thread (i.e.,thread context, but now also at least MMU register values).

You might also like