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

CS 3220: Operating Systems: Instructor

The document provides an overview of operating system processes including their creation, termination, states, and implementation using process control blocks stored in a process table; it also models multitasking with processes by calculating CPU utilization based on the number of concurrently running processes and their average wait time for I/O.

Uploaded by

Zeeshan Wasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

CS 3220: Operating Systems: Instructor

The document provides an overview of operating system processes including their creation, termination, states, and implementation using process control blocks stored in a process table; it also models multitasking with processes by calculating CPU utilization based on the number of concurrently running processes and their average wait time for I/O.

Uploaded by

Zeeshan Wasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

CS 3220:

OPERATING SYSTEMS

LECTURE 1

INSTRUCTOR:
OSAMA AHMED KHAN
A S S I S T A N T P R O F E S S O R , D E PA R T M E N T O F C O M P U T E R
SCIENCE, MAJU
osamaahmedkhan MAR 2ND, 2021
PROCESSES

• Most Central Concept in an Operating System


• Abstraction (Instance) of a Running Program
• Process = Design (Program) + Input + Output + State
• Concurrent operations even on a single Processor (current
assumption)
• Illusion of Parallelism
• Multiprogramming: Processor switches from process to process quickly
(usually every tens or hundreds of milliseconds)
• Sequential processing
• PseudoParallelism
• Shares I/O and other resources in a system
• Should not be programmed with built-in assumptions about timing
• Multiple Processes can run the same program
PROCESSES

• Program Counter (Instruction Counter)


• Indicates where a Processor is in its Program sequence
• Holds memory address of next instruction to be fetched
• Physical vs. Logical Program Counters
PROCESS MODEL
PROCESS CREATION

• Events which cause a process to be created:


1. System initialization
i. Foreground processes (interacting with users)
ii. Background processes (specific functions, Daemons)
2. User’s request
3. A running process calling another process
4. Batch job initiation
• These events are associated with a running process (Parent
process)
• Executes a system call for process creation
• Windows - CreateProcess
• Unix - fork
• Address spaces of Parent and Child processes are unique and
private
PROCESS TERMINATION

• Events which cause a process to be terminated:


• Voluntary
1. Normal Exit
• Windows - ExitProcess
• Unix - exit
2. Simple Error Exit
• Involuntary
1. Fatal Error Exit
2. Killed by another process
• Windows - TerminateProcess
• Unix - kill
• Child processes are not terminated (on killing a Parent process) and vice
versa in Windows and Unix
PROCESS HIERARCHIES

• Unix
• Process Group
• Information is delivered to all members of the group
• Each member might take different action on receiving the information
• Root process – init
• Parent process can not disinherit a Child process

• Windows
• Process Tree
• Parent process is given a token (handle) to control the Child process
• Parent process can disinherit a Child process by passing the token to
some other process
PROCESS STATES

• Running
• Using the Processor
• Ready
• Waiting for its turn to use the Processor
• Resource problem
• Blocked
• Waiting for complete input in order to be ready
• Inherent problem
PROCESS STATES
IMPLEMENTATION OF PROCESSES

• Process Table (for each Process)


• Process Control Blocks (PCBs)
• Information saved to be retrieved later
IMPLEMENTATION OF PROCESSES

• Interrupt Vector
• Small part of Memory
• Contains address of Interrupt Service Procedure

• Interrupt Hardware
• Moves a Process’ PCBs onto Stack on receiving an Interrupt
• Moves back the Process’ PCBs from temporary Stack on finishing
the Interrupt request

• Interrupt Service Procedure


• Moves the Process’ PCBs from Stack to a temporary Stack
• Transferring Process’ PCBs (to and fro) is done in Assembly
language
MODELING MULTIPROGRAMMING

• Increases
  CPU Utilization
• On average a Process requires 20% of the CPU time
• How many Processes are required to make the CPU
completely busy?

• If a Process on average spends a fraction of its time waiting


for I/O requests to complete,
• with Independent Processes in Memory at once, the probability
that all Processes are waiting for I/O is

• What would be the CPU Utilization if all the Processes are


waiting for I/O at a particular instant?
MODELING MULTIPROGRAMMING
MODELING MULTIPROGRAMMING

• What
  if the Processes are considered Dependent?
• In a computer with 8GB Memory, with the OS taking up 2GB
and each User Process also taking up 2GB,
• How many User Processes can exist concurrently?
• If , calculate CPU Utilization and CPU Waste
• If another 8GB Memory is added into the system,
• How many User Processes can exist concurrently?
• What will be the Throughput?
• If another 8GB Memory is added into the system,
• What will be the Throughput?
• What is the reason behind change in increase in Throughput for
same changes made into the system?

You might also like