Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views23 pages

Week 6

The document provides an overview of processes in operating systems, detailing their components, states, and the role of the Process Control Block (PCB). It also explains the concepts of CPU-bound and I/O-bound processes, job queues, and various types of schedulers responsible for managing process execution. Additionally, it describes different types of queues, such as job, device, ready, and print queues, and their significance in optimizing system performance.
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)
16 views23 pages

Week 6

The document provides an overview of processes in operating systems, detailing their components, states, and the role of the Process Control Block (PCB). It also explains the concepts of CPU-bound and I/O-bound processes, job queues, and various types of schedulers responsible for managing process execution. Additionally, it describes different types of queues, such as job, device, ready, and print queues, and their significance in optimizing system performance.
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/ 23

Operating System

By Umer Tanveer
What Is Process?

 A process in an operating system is an instance of a


program that is currently running. It's the active
entity that carries out the instructions defined in the
program. While a program is a passive collection of
instructions, a process is an active execution of
those instructions.
 Component Of a Process
 Program Coe
 Data Segment
 Stack

 Heap
Components

 Program Code (Text Segment): The compiled


instructions of the program.
 Data Segment: Stores the program's data that is
fixed throughout execution.
 Stack: Holds temporary data like function calls and
local variables.
 Heap: Dynamically allocated memory used by the
program during runtime
I/O vs CPU Bound

 CPU-bound and I/O-bound are terms used to


describe the performance of a process or system
based on its resource bottleneck.
 CPU-bound: A process is CPU-bound when it spends
most of its time performing calculations and is
limited by the processing power of the CPU.
Upgrading the CPU or using parallel processing can
improve performance for CPU-bound tasks.
CPU Burst I/O CPU Burst I/O
I/O vs CPU Bound

 I/O-bound: A process is I/O-bound when it spends


most of its time waiting for data transfer from or to
external devices like storage drives or network
connections. Upgrading storage devices or network
bandwidth can improve performance for I/O-bound
tasks. Understanding whether a process is CPU-
bound or I/O-bound is crucial for optimizing its
performance and resource allocation.
I/O Burst CPU Burst I/O Burst CPU Burst
States Of Computer Process

 A computer process goes through various states


throughout its lifecycle, each representing its current
activity:
 New: The process is being created and initialized. *
Ready: The process is prepared to run but is waiting for
the CPU.
 Running: The process is actively executing instructions
on the CPU.
 Waiting: The process is temporarily suspended, waiting
for an event (e.g., I/O completion) to resume execution.
 Terminated: The process has finished execution and its
resources are released.
States Of Computer Process
PCB- Process Control Board

 In an operating system, a Process Control Block


(PCB) is a vital data structure that acts like a
passport for each running process. It stores all the
essential information the operating system needs to
manage and control the process effectively. This
information typically includes:
PCB Components
 Process ID (PID): A unique identifier for the process.
 Process state: The current state of the process
(e.g., running, waiting, ready).
 Program Counter: The memory address of the next
instruction to be executed.
 CPU registers: The current values of the CPU
registers used by the process.
 Memory management information: Details about
the memory allocated to the process.
 I/O information: Information about the I/O devices
the process is using.
Role Of PCB

 The PCB plays a pivotal role in enabling the operating


system to:
 Manage multiple processes efficiently: By keeping track
of each process's state and requirements, the OS can
allocate resources fairly and ensure smooth execution.
 Context switching: When the OS switches between
processes, it saves the state of the current process in its
PCB and restores the state of the new process from its
PCB, allowing for seamless continuation.
 Process termination: When a process finishes execution,
the OS uses the information in the PCB to reclaim its
resources and remove it from the system.
Job Queue

In operating systems, a job queue refers to a queue or list


that contains jobs or tasks awaiting execution on a
computer system. These jobs typically consist of programs
or processes that need to be processed by the operating
system. The job queue helps manage the order in which
these jobs are scheduled and executed by the system.
Components

 Job: A job is a unit of work or a set of instructions that needs to


be executed by the computer system. It can be a program,
script, or any other task that requires processing.
 Job Queue: The job queue is a data structure that holds a list
of jobs waiting to be processed. Jobs are typically added to the
queue in the order they arrive or based on priority.
 Scheduler: The operating system scheduler is responsible for
determining which job from the job queue will be executed
next. Scheduling algorithms may consider factors such as
priority, deadlines, or the order of arrival.
Components..

 Batch Processing: Job queues are commonly used in


batch processing systems, where a set of jobs is
submitted for execution without user interaction. The
operating system processes these jobs one after another
without requiring user intervention.
 Spooling (Simultaneous Peripheral Operations On-line): In
some systems, a job queue is associated with spooling,
where jobs are temporarily stored on a secondary
storage device (e.g., disk) before being processed. This
helps in improving system efficiency and allows for
better job management.
Type of Queue
1. Job Queue:
A Job Queue is a fundamental type of queue in
operating systems. It contains a list of jobs or tasks
that are submitted by users or applications for
execution. The operating system's scheduler manages
this queue, determining the order in which jobs are
processed based on various scheduling algorithms. Job
queues are prevalent in batch processing systems
where tasks are executed one after another without
requiring immediate user interaction.
Type Of Queue
2. Device Queues are queues associated with
input/output (I/O) devices in a computer system.
These queues manage the requests for I/O operations
on devices such as printers, disk drives, or network
interfaces. When multiple processes or jobs compete
for access to a device, a device queue helps maintain
the order in which requests are serviced. This ensures
efficient utilization of the devices and prevents
contention issues.
Type Of Queue

 3. Ready Queue: The Ready Queue is a a that holds


processes or threads that are ready to be executed
by the CPU. Processes in the Ready Queue are in a
runnable state, meaning they have all the resources
they need to execute, and the CPU scheduler can
select them for execution. The CPU scheduler
decides the order in which processes are moved
from the Ready Queue to the running state.
Type Of Queue
 4. Print Queue:
Print Queue manages the order in which print jobs are sent
to a printer. Users submit documents for printing, and the
print queue ensures that these print jobs are processed in a
sequential manner. This helps in avoiding conflicts and
ensures fair access to the printing resources.
Queue In OS
Queues in a Computer System
Scheduler

 Incomputing, a scheduler a component of


the operating system responsible for
managing and controlling the execution of
processes or tasks on a computer system.
Its primary function is to determine the
order and timing of task execution, ensuring
efficient and fair utilization of the CPU
(Central Processing Unit) and other
resources.
Types

 1. Long-Term Scheduler (Job Scheduler):


The Long-Term Scheduler, also known as the Job Scheduler,
is a component of the operating system that handles the
selection and admission of processes into the system for
execution. It decides which processes from the job queue,
where various tasks or jobs are waiting, should be brought
into main memory for processing. This scheduler plays a
crucial role in overall system efficiency, as it determines
the number of processes that can be concurrently active,
balancing resource utilization and avoiding overloading the
system.
Types

 Short-Term Scheduler (CPU Scheduler):


The Short-Term Scheduler, or CPU Scheduler, is
responsible for managing the execution of processes that
are already in main memory. It selects processes from
the ready queue, where tasks are waiting to be executed,
and allocates CPU time to them. The primary objective is
to maintain efficient CPU utilization, minimize waiting
times, and ensure fairness among competing processes.
The short-term scheduler operates at a rapid pace,
making frequent decisions to keep the CPU busy and
responsive.
Types
 3. Medium-Term Scheduler:
The Medium-Term Scheduler is an additional
component found in some operating systems. It deals
with the swapping of processes between main
memory and secondary storage (such as a hard disk).
When the system determines that a process should
be temporarily removed from main memory to free
up space or for other reasons, the medium-term
scheduler facilitates the swapping process. This helps
in efficient memory management and can improve a
overall system performance by optimizing the use of
available resources.

You might also like