Topic:
Processes
Page 1 out of 7
Process
• Program that is in execution.
• More than the program code
• Has several parts
• Text Section- Contains the code of the program.
• Stack- Contains Temporary data(Function parameters, local var, Return
address).
• Data Section- Contains Global var
• Heap- Contains dynamic memory allocated during process run time.
Page 2 out of 7
Process State
• New- The process is being created.
• Ready- All the resources are
available, process is waiting to be
assigned to a processor
• Running- The CPU is working on this
process's instructions.
• Waiting- The process is waiting for
some event to occur (such as an I/O
completion or reception of a signal).
• Terminated- The process has
finished execution.
Page 3 out of 7
Process or Task Control Block
Process is represented in the operating system by a
process control block. Contains many information of a
specific process including these:
• Process State - Ready, Running, waiting, etc.
• Process Number – Process number and parent process
ID.
• Program counter - Indicates the address of the next
instruction to be executed for this process.
• Registers - This state information must be saved when
an interrupt occurs, to allow the process to be
continued correctly in further process.
• List of open files - It saves device allocated, open file
tables, etc.
Page 4 out of 7
Process Scheduler & Context Switching
Operating system uses a program scheduler to schedules the processes
of computer system
• LTS - Selects process from job pool and loads them into memory.
• STC - Selects among the processes that are ready to execute.
Context Switching: Saves the current PCB and switch into next PCB. This
task is known as a context switch. Happens by interrupt or some higher
priority task.
Page 5 out of 7
Page 6 out of 7

Processes in Operating System

  • 1.
  • 2.
    Process • Program thatis in execution. • More than the program code • Has several parts • Text Section- Contains the code of the program. • Stack- Contains Temporary data(Function parameters, local var, Return address). • Data Section- Contains Global var • Heap- Contains dynamic memory allocated during process run time. Page 2 out of 7
  • 3.
    Process State • New-The process is being created. • Ready- All the resources are available, process is waiting to be assigned to a processor • Running- The CPU is working on this process's instructions. • Waiting- The process is waiting for some event to occur (such as an I/O completion or reception of a signal). • Terminated- The process has finished execution. Page 3 out of 7
  • 4.
    Process or TaskControl Block Process is represented in the operating system by a process control block. Contains many information of a specific process including these: • Process State - Ready, Running, waiting, etc. • Process Number – Process number and parent process ID. • Program counter - Indicates the address of the next instruction to be executed for this process. • Registers - This state information must be saved when an interrupt occurs, to allow the process to be continued correctly in further process. • List of open files - It saves device allocated, open file tables, etc. Page 4 out of 7
  • 5.
    Process Scheduler &Context Switching Operating system uses a program scheduler to schedules the processes of computer system • LTS - Selects process from job pool and loads them into memory. • STC - Selects among the processes that are ready to execute. Context Switching: Saves the current PCB and switch into next PCB. This task is known as a context switch. Happens by interrupt or some higher priority task. Page 5 out of 7
  • 6.