0% found this document useful (0 votes)
10 views21 pages

Unit 2 Processes and Services

The document outlines the services and properties of an operating system, including error detection, program execution, communication, and resource allocation. It also discusses operations on processes such as creation, scheduling, blocking, and termination, along with the types of schedulers used in process management. Key properties of operating systems like multiprogramming, real-time systems, and multitasking are also highlighted.

Uploaded by

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

Unit 2 Processes and Services

The document outlines the services and properties of an operating system, including error detection, program execution, communication, and resource allocation. It also discusses operations on processes such as creation, scheduling, blocking, and termination, along with the types of schedulers used in process management. Key properties of operating systems like multiprogramming, real-time systems, and multitasking are also highlighted.

Uploaded by

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

NATIONAL INSTITUTE OF PUBLIC ADMINISTRATION

BoCS 2050: OPERATING SYSTEM

UNIT 2: UNDERSTANDING THE SYNCHRONIZATION PROCESS


PROCESSES AND SERVICES
Services provided by an Operating System
An operating system provides users the services to execute a program and provides
the program an environment to execute.

Common services provided by an operating system are as follows:

• Error detection
• Program Execution
• Communication
• Input and output operations
• Resource allocation
• File system manipulation
• Protection

Services provided by an Operating System


Error detection

The operating system constantly checks for errors, keeps the user updated about
the status, and resolves the error to ensure correct and consistent computing.

Program execution

The operating system must be able to handle program execution. It also provides a
mechanism for process synchronization, communication, and deadlock handling.

Services provided by an Operating System


Communication

The operating system looks after routing and connection strategies.


A computer may need to receive data from another computer that is connected
through a computer network, the OS would implement the communication either by
shared memory or by message passing.

Input and output operations

I\O operations may be needed by the programs that are currently executing. The OS
provides access to I\O operations(read or write operations of any file) as the user
cannot directly interact with the devices.

Services provided by an Operating System


Resource allocation

When multiple programs are running simultaneously, resources need to be


allocated to each of them. The OS uses CPU scheduling to manage all kinds of
resources and for better utilization of the CPU.
File System Manipulation

The operating system creates an interface for the user to create, delete, and
backup the files. The file system is organized into directories which makes it easier
for the user to navigate through them. The OS is also responsible for programs that
may need permission to access the directories or the files.

Services provided by an Operating System


Protection

The operating system ensures security by controlling access to the system


resources. The user needs to authenticate themselves before using the system.

Properties of an Operating System


Properties of the Operating System are as follows:

• Multiprogramming
• Real-time system
• Distributed environment
• Batch processing
• Interactivity
• Spooling
• Multitasking

Properties of an Operating System


Multiprogramming

Multiprogramming can be defined as the ability of an operating system to run multiple


programs on a single processor machine at the same time.
Multiprogramming is economical, utilizes the CPU to its maximum capability, and manages
the main memory efficiently.

Real-time system

The operating system ensures that the response is given in a specified time constraint to
provide accurate performance.

Properties of an Operating System


Distributed environment

The distributed environment is used when the data has been saved at different locations but
needs to be available locally most of the time, it also reduces the impact of hardware failure or any
specific site.
It can be defined as a set of multiple processors in a single computer system.

Batch processing

The operating system defines a set of jobs that are re-assigned to a command sequence,
programs, and data with a single unit.
In batch processing, the performance is increased as the old job gets completed faster without any
manual interference and the new job is started earlier.

Properties of an Operating System


Interactivity

Interactivity means the user’s ability to interact with the computer system.
To help users interact with the system, the OS handles input and output devices and
provides an interface to the user.

Spooling

Spooling stands for Simultaneous Peripheral Operation Online. It is a process in which data
is temporarily held to be used and executed by a device, program, or system.
The OS manages I\O device spooling when it has multiple data access rates.

Properties of an Operating System


Multitasking

In multitasking, the CPU executes multiple jobs at the same by switching between the jobs.
The OS handles multiple operations at the same time, this is also known as time-sharing.
Operations on Processes
What is a process?

A program that is under execution is known as a process.

Operation on the process:

The user can perform the following operations on a process in the operating system:

• Process creation
• Process scheduling or dispatching
• Blocking
• Preemption
• Termination
Operations on Processes
Process creation

Process creation is the initial step to process execution. It implies the creation
of a new process for execution.

Process scheduling\dispatching

Scheduling or dispatching refers to the event where the OS puts the process
from ready to running state. It is done by the system when there are free
resources or there is a process of higher priority than the ongoing process.
Operations on Processes
Blocking

Block mode is a mode where the system waits for input-output. In process blocking
operation, the system puts the process in the waiting state. When a task is blocked, it is
unable to execute until the task prior to it has finished using the shared resource. Examples
of shared resources are the CPU, network and network interfaces, memory, and disk.

Preemption

Preemption means the ability of the operating system to preempt a currently scheduled task
in favour of a higher priority task. The resource being scheduled can be the processor or the
I\O.
Operations on Processes
Termination

Ending a process is known as process termination. There are many events that may lead to
process termination, some of them are:

1. One process terminating the other process.


2. A problem in the hardware.
3. The process is fully executed, implying that the OS is finished.
4. An operating system might terminate itself due to service errors.
Process Scheduling
What is process scheduling?

Process scheduling is an Operating System task that is used to schedule processes of


different states like ready, waiting, and running. It keeps the CPU busy all the time, hence
decreasing the response time for the programs.

Process Scheduling
Process Scheduling Queues

Process scheduling queues are used by the OS to maintain a distinct queue for every PCB
and process state.

The process scheduling queues maintained by the OS are as follows:

Job queue: It helps store all the processes in the system.


Ready queue: It helps set every process that is sitting in the main memory waiting to be
executed.
Device queue: It is a process blocked due to the unavailability of I\O devices.

Process Scheduling
Two State Process Model
Two state process models are as follows:

Running
Not Running

Running
In the operating system when a new process is created it enters the system in running state.

Not running
The processes that are kept in the queue are in “Not Running” state.

Process Scheduling
Scheduling objectives:

Some of the important objectives of process scheduling are:


1. It should achieve a balance between utilization and response.
2. Reference should be given to the processes holding key resources.
3. It should avoid postponement and enforce priorities.
4. It should increase the number of interactive users within an acceptable response time.

Types of Schedulers
A scheduler is a type of system software that allows us to handle process scheduling.

There are three types of schedulers:

• Short-term scheduler
• Medium-term scheduler
• Long-term scheduler
Types of Schedulers
Short-term scheduler

Short-term scheduler or CPU scheduler is used to boost the system performance. It decides
which of the ready processes are supposed to be executed.

Medium-term scheduler

Medium-term scheduler temporarily removes processes from the main memory and stores
them in the secondary memory or the other way round. This process is also known as
swapping in or out.
Types of Schedulers
Short-term Scheduler vs Medium-term Scheduler vs Long-term Scheduler
End

You might also like