SlideShare a Scribd company logo
Process Concept
Program, Process, Processor
• A progam is a set of instructions. A process is a program in execution.
It is a unit of work within the system. Program is a passive entity,
process is an active entity.
• Processor is the device which executes programs.
• Process needs resources to accomplish its task
– CPU, memory, I/O, files
– Initialization data
• Process termination requires reclaim of any reusable resources
Threads
• A thread is predefined instance of a process. A thread performs a specific
function. A process may consist a set of threads
• Single-threaded process has one program counter specifying location of
next instruction to execute
– Process executes instructions sequentially, one at a time, until completion
• Multi-threaded process has one program counter per thread
• Typically system has many processes, some user, some operating system
running concurrently on one or more CPUs
– Concurrency by multiplexing the CPUs among the processes / threads
Single and Multithreaded Processes
Process Management Activities
• The operating system is responsible for the
following activities in connection with process
management:
– Creating and deleting both user and system
processes
– Suspending and resuming processes
– Providing mechanisms for process synchronization
– Providing mechanisms for process communication
– Providing mechanisms for deadlock handling
Process Creation
• System Initialization – Boots up
• User related events – click, double click, drag
• Execution of a function call- process creates a
child process
Process Termination
• System shut down
• Process termination – completes execution
• Error condition(Voluntary)
• Fatal error(Involuntary
• Killed by another process
Process States
• New – just created, arrived in memory
• Ready – prepared for execution once the CPU
becomes available
• Running – Being executed.
• Blocked – has suspended running, requires an
I/O device.
• Terminated – Has finished executed, prepared
to exit memory.
Process Control Block (PCB)
Stores Information associated with each
process
• Process state
• Program counter
• CPU registers
• CPU scheduling information
• Memory-management information
• Accounting information
• I/O status information
Process Control Block (PCB)
Process Interruption
• CPU Switch From Process to Process
Process Scheduling Queues
• Ready queue – set of all processes residing in
main memory, ready and waiting to execute
• Device queues – set of processes waiting for
an I/O device
• Processes migrate among the various queues
Representation of Process Scheduling
Context Switch
• When CPU switches to another process, the
system must save the state of the old process and
load the saved state for the new process
• Context-switch time is overhead; the system does
no useful work while switching
• Time dependent on hardware support
Process Creation
• Parent process create children processes, which,
in turn create other processes, forming a tree of
processes
• Resource sharing may be
– Parent and children share all resources
– Children share subset of parent’s resources
– Parent and child share no resources
• Execution mode may be
– Parent and children execute concurrently
– Parent waits until children terminate
Process Termination
• Process executes last statement and asks the operating
system to delete it (exit)
– Output data from child to parent (via wait)
– Process’ resources are deallocated by operating system
• Parent may terminate execution of children processes
(abort) if
– Child has exceeded allocated resources
– Task assigned to child is no longer required
– If parent is exiting
• Some operating system do not allow child to continue if its parent
terminates
– All children terminated - cascading termination

More Related Content

PPTX
Operating system 17 process management
PPTX
Os concepts 4 functions of os
PPTX
Operating system 18 process creation and termination
PPTX
Operating system 05 functions of os
PPTX
Processes
PDF
Ch3 processes
PPTX
Operating system concepts
PDF
CSI-503 - 2. Processor Management
Operating system 17 process management
Os concepts 4 functions of os
Operating system 18 process creation and termination
Operating system 05 functions of os
Processes
Ch3 processes
Operating system concepts
CSI-503 - 2. Processor Management

What's hot (20)

PPTX
Os unit 2
PPTX
Operating systems
PPTX
Processes and operating systems
PPT
Lecture5
PPTX
Basic concept of process
PPTX
Unit v: Device Management
PPTX
Operating system 31 multiple processor scheduling
PPTX
Mis unit iii by arnav
PDF
Operating Systems 1 (6/12) - Processes
PPT
08 operating system support
PPT
Process management
PPT
08 operating system support
PPTX
Process Control Block & Threads and Their Management
PPTX
Memory management1
PPTX
Learn about computer hardware and software
PPTX
Os unit 3 , process management
PPTX
Unit 1 operating system
Os unit 2
Operating systems
Processes and operating systems
Lecture5
Basic concept of process
Unit v: Device Management
Operating system 31 multiple processor scheduling
Mis unit iii by arnav
Operating Systems 1 (6/12) - Processes
08 operating system support
Process management
08 operating system support
Process Control Block & Threads and Their Management
Memory management1
Learn about computer hardware and software
Os unit 3 , process management
Unit 1 operating system
Ad

Viewers also liked (10)

PPTX
PAQUETE MATEMATICO grado 5° primaria
PPSX
Práctica ofimática
PPTX
Unidadesdemedida 140516185146-phpapp02
PPTX
Ofimatica i clase
PPTX
Construcción de las unidades de medida
DOCX
Planeacion bloque i - primero
DOCX
Plan de aula tecnologia 2014 2015 primaria 3-5
DOCX
Plan de asignatura tecnologia 2014 completo
PDF
Plan anual ofimatica 2º 2014 2015
PDF
Actividades de matemáticas 2º educación primaria
PAQUETE MATEMATICO grado 5° primaria
Práctica ofimática
Unidadesdemedida 140516185146-phpapp02
Ofimatica i clase
Construcción de las unidades de medida
Planeacion bloque i - primero
Plan de aula tecnologia 2014 2015 primaria 3-5
Plan de asignatura tecnologia 2014 completo
Plan anual ofimatica 2º 2014 2015
Actividades de matemáticas 2º educación primaria
Ad

Similar to Processes (20)

PPTX
Process and thread Management Operating system
PPTX
Operating Systems Process Management.pptx
PPTX
operating system module 2 presentation notes
PPTX
Chapter -2 operating system presentation
PDF
process.pdfzljwiyrouyaeutoaetodtusiokklhh
PDF
Process Management.pdf
PDF
OS - Process Concepts
PDF
Unit 2 part 1(Process)
PPTX
Operating System Process Scheduling.pptx
PPTX
2 Process and Thread_java20231123-3.pptx
PPTX
Process management os concept
PPTX
Process management1
PDF
Lecture - 1_Process Management.pdf
DOC
Operating Systems Unit Two - Fourth Semester - Engineering
PPTX
Lecture 2 process
PPTX
OS - Chapter # 3 for the development of os
PPTX
UNIT 2 OS.pptx Introduction of Operating System
PDF
OS-Process.pdf
PDF
Unit 1.1.pdfOperating_SystemOperating_System
PDF
Operating System-Concepts of Process
Process and thread Management Operating system
Operating Systems Process Management.pptx
operating system module 2 presentation notes
Chapter -2 operating system presentation
process.pdfzljwiyrouyaeutoaetodtusiokklhh
Process Management.pdf
OS - Process Concepts
Unit 2 part 1(Process)
Operating System Process Scheduling.pptx
2 Process and Thread_java20231123-3.pptx
Process management os concept
Process management1
Lecture - 1_Process Management.pdf
Operating Systems Unit Two - Fourth Semester - Engineering
Lecture 2 process
OS - Chapter # 3 for the development of os
UNIT 2 OS.pptx Introduction of Operating System
OS-Process.pdf
Unit 1.1.pdfOperating_SystemOperating_System
Operating System-Concepts of Process

Processes

  • 2. Program, Process, Processor • A progam is a set of instructions. A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. • Processor is the device which executes programs. • Process needs resources to accomplish its task – CPU, memory, I/O, files – Initialization data • Process termination requires reclaim of any reusable resources
  • 3. Threads • A thread is predefined instance of a process. A thread performs a specific function. A process may consist a set of threads • Single-threaded process has one program counter specifying location of next instruction to execute – Process executes instructions sequentially, one at a time, until completion • Multi-threaded process has one program counter per thread • Typically system has many processes, some user, some operating system running concurrently on one or more CPUs – Concurrency by multiplexing the CPUs among the processes / threads
  • 5. Process Management Activities • The operating system is responsible for the following activities in connection with process management: – Creating and deleting both user and system processes – Suspending and resuming processes – Providing mechanisms for process synchronization – Providing mechanisms for process communication – Providing mechanisms for deadlock handling
  • 6. Process Creation • System Initialization – Boots up • User related events – click, double click, drag • Execution of a function call- process creates a child process
  • 7. Process Termination • System shut down • Process termination – completes execution • Error condition(Voluntary) • Fatal error(Involuntary • Killed by another process
  • 9. • New – just created, arrived in memory • Ready – prepared for execution once the CPU becomes available • Running – Being executed. • Blocked – has suspended running, requires an I/O device. • Terminated – Has finished executed, prepared to exit memory.
  • 10. Process Control Block (PCB) Stores Information associated with each process • Process state • Program counter • CPU registers • CPU scheduling information • Memory-management information • Accounting information • I/O status information
  • 12. Process Interruption • CPU Switch From Process to Process
  • 13. Process Scheduling Queues • Ready queue – set of all processes residing in main memory, ready and waiting to execute • Device queues – set of processes waiting for an I/O device • Processes migrate among the various queues
  • 15. Context Switch • When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process • Context-switch time is overhead; the system does no useful work while switching • Time dependent on hardware support
  • 16. Process Creation • Parent process create children processes, which, in turn create other processes, forming a tree of processes • Resource sharing may be – Parent and children share all resources – Children share subset of parent’s resources – Parent and child share no resources • Execution mode may be – Parent and children execute concurrently – Parent waits until children terminate
  • 17. Process Termination • Process executes last statement and asks the operating system to delete it (exit) – Output data from child to parent (via wait) – Process’ resources are deallocated by operating system • Parent may terminate execution of children processes (abort) if – Child has exceeded allocated resources – Task assigned to child is no longer required – If parent is exiting • Some operating system do not allow child to continue if its parent terminates – All children terminated - cascading termination