Amrita
School
of
Engineering,
Bangalore
Ms. Harika Pudugosula
Teaching Assistant
Department of Electronics & Communication Engineering
6/30/2022 2
 Process Concept
 Process Scheduling
 Operations on Processes
 Interprocess Communication
6/30/2022 3
 To introduce the notion of a process - a program in execution, which
forms the basis of all computation
 To describe the various features of processes, including scheduling,
creation and termination, and communication
 To explore interprocess communication using shared memory and
message passing
3
6/30/2022 4
 Chapter Introduction
 Process Concept
 The Process
 Process State
 Process Control Block (PCB)
 Threads
30-Jun-22 5
Chapter Introduction
• Process - Program in execution
• Need resources to accomplish tasks
• Allocation of resources
• Unit of work in modern time-sharing systems - Process
• OS processes execute system code
• User processes execute user code
6/30/2022 6
 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
30-Jun-22 7
Process Concept
An operating system executes a variety of programs:
• Batch system – jobs
• Time-shared systems – user programs or tasks
Textbook uses the terms job and process almost
interchangeably
 The Process
 Process - a program in execution
- a process execution must progress in sequential fashion
 Multiple parts
• The program code, also called text section - it
includes current activity, as represented by the
value of program counter the contents of
processor’s registers
• Stack containing temporary data
• Function parameters, return addresses, local
variables
• Data section containing global variables
• Heap - memory that is dynamically allocated
during process run time
fig. Process in memory
 Program is passive entity stored on secondary storage disk
(executable file)
 Process is active entity, with a PC specifying next instruction to be
execute and a set of associated resources
 Program becomes process when executable file loaded into memory
 Two common techniques for loading executable file
• Double-clicking an icon representing the executable file
• Entering the name of the executable file on command prompt
• Two processes may be associated with the same program, but
separate proces; the text sections are equivalent, the data, heap,
and stack sections vary
30-Jun-22 10
 Process State
As a Process executes, it changes its state (current activity of the
process)
• New - The process is being created
• Running - Instructions are being executed
• Waiting - The process is waiting for some event to occur (such as
an I/O completion or reception of a signal)
• Ready - The process is waiting to be assigned to a processor
• Terminated - The process has finished execution
 Name of the states are arbitary
 Only one process can be running on any processor at any instant,
many processes may be ready and waiting
30-Jun-22 11
fig.
30-Jun-22 12
 Process Control Block
• Contains information associated with each
process - task control block
• Process state – running, waiting, etc
• Program counter – location of instruction to
next execute
• CPU registers – contents of all process-centric
registers
• CPU scheduling information- priorities,
scheduling queue pointers fig. Process Control
Block
30-Jun-22 13
 Process Control Block
• Memory management information – memory
allocated to the process, base and limit
register,page table ,segment table
• Accounting information – CPU used, clock
time elapsed since start, time limits
• I/O status information – I/O devices allocated
to process, list of open files
 PCB simply serves as the repository for any
information that may vary from process to
process fig. Process Control
Block
30-Jun-22 14
fig.
30-Jun-22 15
 Threads
• Process that performs a single thread of execution
• Consider having multiple program counters per process
• Multiple locations can execute at once
• Modern OS, allows to have multiple threads of execution, more than
one task at a time
• Must then have storage for thread details, multiple program counters
in PCB
30-Jun-22 16
References
1. Silberscatnz and Galvin, “Operating System Concepts,” Ninth Edition,
John Wiley and Sons, 2012.
30-Jun-22 17
Thank you

Lecture - 1_Process Management.pdf

  • 1.
    Amrita School of Engineering, Bangalore Ms. Harika Pudugosula TeachingAssistant Department of Electronics & Communication Engineering
  • 2.
    6/30/2022 2  ProcessConcept  Process Scheduling  Operations on Processes  Interprocess Communication
  • 3.
    6/30/2022 3  Tointroduce the notion of a process - a program in execution, which forms the basis of all computation  To describe the various features of processes, including scheduling, creation and termination, and communication  To explore interprocess communication using shared memory and message passing 3
  • 4.
    6/30/2022 4  ChapterIntroduction  Process Concept  The Process  Process State  Process Control Block (PCB)  Threads
  • 5.
    30-Jun-22 5 Chapter Introduction •Process - Program in execution • Need resources to accomplish tasks • Allocation of resources • Unit of work in modern time-sharing systems - Process • OS processes execute system code • User processes execute user code
  • 6.
    6/30/2022 6  Theoperating 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
  • 7.
    30-Jun-22 7 Process Concept Anoperating system executes a variety of programs: • Batch system – jobs • Time-shared systems – user programs or tasks Textbook uses the terms job and process almost interchangeably  The Process  Process - a program in execution - a process execution must progress in sequential fashion
  • 8.
     Multiple parts •The program code, also called text section - it includes current activity, as represented by the value of program counter the contents of processor’s registers • Stack containing temporary data • Function parameters, return addresses, local variables • Data section containing global variables • Heap - memory that is dynamically allocated during process run time fig. Process in memory
  • 9.
     Program ispassive entity stored on secondary storage disk (executable file)  Process is active entity, with a PC specifying next instruction to be execute and a set of associated resources  Program becomes process when executable file loaded into memory  Two common techniques for loading executable file • Double-clicking an icon representing the executable file • Entering the name of the executable file on command prompt • Two processes may be associated with the same program, but separate proces; the text sections are equivalent, the data, heap, and stack sections vary
  • 10.
    30-Jun-22 10  ProcessState As a Process executes, it changes its state (current activity of the process) • New - The process is being created • Running - Instructions are being executed • Waiting - The process is waiting for some event to occur (such as an I/O completion or reception of a signal) • Ready - The process is waiting to be assigned to a processor • Terminated - The process has finished execution  Name of the states are arbitary  Only one process can be running on any processor at any instant, many processes may be ready and waiting
  • 11.
  • 12.
    30-Jun-22 12  ProcessControl Block • Contains information associated with each process - task control block • Process state – running, waiting, etc • Program counter – location of instruction to next execute • CPU registers – contents of all process-centric registers • CPU scheduling information- priorities, scheduling queue pointers fig. Process Control Block
  • 13.
    30-Jun-22 13  ProcessControl Block • Memory management information – memory allocated to the process, base and limit register,page table ,segment table • Accounting information – CPU used, clock time elapsed since start, time limits • I/O status information – I/O devices allocated to process, list of open files  PCB simply serves as the repository for any information that may vary from process to process fig. Process Control Block
  • 14.
  • 15.
    30-Jun-22 15  Threads •Process that performs a single thread of execution • Consider having multiple program counters per process • Multiple locations can execute at once • Modern OS, allows to have multiple threads of execution, more than one task at a time • Must then have storage for thread details, multiple program counters in PCB
  • 16.
    30-Jun-22 16 References 1. Silberscatnzand Galvin, “Operating System Concepts,” Ninth Edition, John Wiley and Sons, 2012.
  • 17.