0% found this document useful (0 votes)
124 views

Lecture 4 Process Management

A process is an instance of a running program. The operating system maintains information about each process in a process control block, which tracks the process's status, memory usage, and other resources. Processes can be in one of three states: ready, running, or blocked. Multiprogramming allows multiple processes to run concurrently by rapidly switching the CPU between them, improving responsiveness and hardware utilization.

Uploaded by

Marvin Bucsit
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Lecture 4 Process Management

A process is an instance of a running program. The operating system maintains information about each process in a process control block, which tracks the process's status, memory usage, and other resources. Processes can be in one of three states: ready, running, or blocked. Multiprogramming allows multiple processes to run concurrently by rapidly switching the CPU between them, improving responsiveness and hardware utilization.

Uploaded by

Marvin Bucsit
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Process Management

IT6 – Operating Systems


What is a process?
 A process is an instance of an application in
execution.
 The application may be a program written by a user,
or a system application.
 Users may run many instances of the same
application at the same time, or run many different
applications.
 The process only exists for the duration of executing
the application.
2
What is a process? …cont.
 Its CPU state (register values).
 The current state of the CPU is given by the contents of its
registers – IR, PC, SP etc.
 Its address space (memory contents).
 Only a small part of an applications data can be stored in
registers. The rest is in memory.
 Its environment
 A process does not exist in a vacuum. It typically has
connections with other entities, such as Open files that are
used for input and output.
3
Process Management
 The OS must allocate resources to processes, enable
processes to share and exchange information, protect
the resources of each process from other processes
and enable synchronization among processes.
 To meet these requirements, the OS must maintain a
data structure for each process, which describes the
state and resource ownership of that process, and
which enables the OS to exert control over each
process.
4
The Process Control Block (PCB)
 When a new process is to be added to those currently
being managed, the OS builds a data structure called
a Process control block (PCB)
 The PCB contains the following:
 identifies the job
 indicates its current status (READY, RUNNING & BLOCKED)
 stores the current instruction counter
 takes a snapshot of the register contents
 indicates required memory locations
 specifies resource needs
 specifies priority if required
5
Process Creation
 Four common events can lead to the creation
of a process:
 New batch job.
 Interactive logon
 Created by OS.
 Spawned by existing processes, e.g. parent/child.

6
Process Termination
 Batch job issues stop instruction
 User logs off
 Process executes a service request to terminate
 Error and fault conditions
 Normal completion
 Time limit exceeded
 Memory unavailable
 Others…
7
Process States
 Processes change state during their execution,
sometimes by themselves (e.g. by making a system
call), and sometimes due to an external event (e.g.
when the CPU gets a timer interrupt).
 READY, RUNNING and BLOCKED
 once a process is created, it can stay in of the three
states

8
Process State Transition

dispatch
ready

Pre-empt terminated
Event done run

Wait for event


blocked

9
Types of Processes
 Foreground Process
 Background Process
 I/O-bound process – spends more time doing
I/O than computations, many short CPU
bursts
 CPU-bound process – spends more time
doing computations; few very long CPU
bursts
10
Process Concurrency: Terms
 Multitasking — having multiple processes
time slice on the same processor.
 Multiprogramming —having multiple jobs in
the system(either on the same processor, or on
different processors)
 Multiprocessing — using multiple processors
for the same job or system (i.e. parallel
computing).
11
Multiprogramming
 a system executing many processes concurrently
 multiple processes are handled by the system at the
same time, typically by time slicing
 requires that the processor be allocated to each
process for a period of time and de-allocated at an
appropriate moment
 The stopping of one process and starting (or
restarting) of another process is called a context
switch.
12
Why use multiprogramming?
 to improve responsiveness, which means that users
will have to wait less (on average) for their jobs to
complete
 to improve hardware utilization
 Applications use one system component at a time
 allows for simultaneous use of several components
 allows for concurrent programming, in which the
multiple processes interact to work on the same
problem
13

You might also like