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

Don OS

The document discusses CPU scheduling algorithms in operating systems, outlining key terminologies and various types such as First Come First Serve, Short Job First Scheduling, Priority Scheduling, Round Robin Scheduling, Multilevel Queue Scheduling, and Multilevel Feedback Scheduling, along with their advantages and disadvantages. It also explains the Process Control Block (PCB), detailing its contents, functions in process management, and associated advantages and disadvantages. Overall, it provides a comprehensive overview of CPU scheduling and process management concepts.
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)
5 views

Don OS

The document discusses CPU scheduling algorithms in operating systems, outlining key terminologies and various types such as First Come First Serve, Short Job First Scheduling, Priority Scheduling, Round Robin Scheduling, Multilevel Queue Scheduling, and Multilevel Feedback Scheduling, along with their advantages and disadvantages. It also explains the Process Control Block (PCB), detailing its contents, functions in process management, and associated advantages and disadvantages. Overall, it provides a comprehensive overview of CPU scheduling and process management concepts.
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/ 6

NAME: Oketch Donald

Odhiambo
REG.NO: IN14/00094/24.
SCHOOL: SIST
DEPARTMENT: COMPUTING
UNIT CODE: COMP 113
ASSIGNMENT 1
Q.1: DISCUSS CPU SCHEDULING ALGORITHMS IN OPERATING SYSTEM
.CPU Scheduling is the process of deciding which process will own the CPU to use while other
process is suspended .It ensures that whenever the CPU remains idle , the operating system has at
least selected one of the processes available in a ready to use line.

Terminologies used in CPU Scheduling

1.Arrival time – The time at which the process arrives in the ready queue

2.Completion time – The time at which the process completes its execution.

3.Burst time – The time required by a process for CPU execution

4.Turn Around time – Time difference between completion time and arrival time

Turn around time = Completion time – Arrival time

5.Waiting Time – Difference between Turn around Time and Burst Time .

Waiting Time = Turn Around Time – Burst Time.

TYPES OF CPU SCHEDULING ALGORITHMS

1.First Come First Serve – This is where the process which arrives first ,gets executed first or The
process which requests the CPU first, gets the CPU allocated first. i.e the process is executed in the
order they arrive .

Advantage: Easy to implement and it’s fair.

Disadvantage : Can cause Convoy effect , leading to high waiting time for shorter processes.

NB: Convoy effect is a situation where many processes , who need to use a resource for short time
are blocked by one process holding that resource for a long time.

2.Short Job First Scheduling (SJFS) – This is where the process that has the shortest Burst time will be
executed first.

It can be preemptive or Non-Preemptive

Preemptive is CPU scheduling technique where a running process can be interrupted and moved to
the ready queue if a higher priority process arrives or its time slice expires.

Non Preemptive is a CPU scheduling technique where once the process once assigned the CPU ,runs
to completion or until it voluntarily releases the CPU.

Advantage :Minimizes average waiting time.

Disadvantage :Hard to predict burst time and may cause starvation for long processes.

3.Priority Scheduling: This is where the scheduling is done on the basis of priority of the process
where the process which I most urgent is processed first followed by the ones with lesser priority in

order.
The processes with same priority will be served in the basis of First Come First Servs.

a. Preemptive Priority Scheduling-If the new jo arrives at the queue and has higher priority, the
processing of the current job is stopped and the incoming job with higher priority gets to
the CPU for processing.
b. B. Non preemptive Priority Scheduling- If a new process arrives with higher priority than the
current running process, the incoming process is put on to of the ready queue so after the
execution of the current process it will be processed.
Advantage: improves system performance as High priority tasks completes faster enhancing
system responsiveness for time sensitive applications
Disadvantage: Starvation problem – Low priority tasks may never get CPU time incase higher
priority tasks keep on arriving.

4.Round Robin Scheduling- this algorithm assigns a fixed time slice to each job in the ready queue
circles through them in a circular manner .If the process does not complete within its allotted time
it’s moved to the back of the queue allowing the next process a turn .this continues till completion
of all processes.

Advantage: Suitable for time sharing systems

:Ensures responsiveness for interactive users.

Disadvantage: Frequent context switching can lead to overheat

5.Multilevel Queue Scheduling- is a CPU scheduling algorithm that divide the ready queue into
multiple separate queues, each assigned different scheduling algorithms and priorities.

Advantage: Prioritization improves system performance.

Disadvantage: Processes in lower priority queues may suffer starvation if those in higher priority
queues are always busy.

6.Multilevel feedback scheduling- This an algorithm which allows jobs to move between multiple
priority queues based on their behavior and execution history.

Advantage: Prevents starvation by allowing low priority tasks to get CPU time.

Disadvantage: Complex to implement due to frequent priority adjustments.

Q2.Discuss Process Control Block.


It is the data structure used by a computer operating system to store all the information about a
process. It keeps the track of information about a specific process since the CPU requires this
information to keep to complete the job.

Contents of Process Control Block

1.Process ID- A unique identifier assigned to each process.

2.Process state- Describes whether the process is new ,Ready ,Running ,Waiting or Terminated.
3.Program Counter- Stores the address of the next instructions to execute.

4.CPU Registers -Holds the values of registers like the accumulator ,stack pointer and general-
purpose registers.

5.Memory management Information- Includes details like base and limits registers and page tables
used in memory allocation.

6.Scheduling Information- Contains priority level, scheduling queue pointers and process execution
time.

7.I/O status Information- Stores information about allocated I/O devices, open files and I/O requests.

8.Accounting Information: Tracks CPU usage ,execution time, and user ID.

Functions of PCB in Process Management

1.Contex Switching- The OS saves the PCB when a process is switched out and restores it when
resuming

2.Process synchronization and Communication: Aids in coordinating process and handling inter-
process communication (IPC)

3.Resource allocation: Helps in managing the memory, CPU time and I/O resources.

=Advantages: Fault detection and recovery- Helps to identifying and handling process failures.

: Improves Scheduling by helping the OS to decide which process to execute next based
on priority and scheduling algorithms.

=Disadvantages: Increases Overhead -Storing and updating PCBs require additional system resources
like memory and CPU cycles.

: Security concerns- If unauthorized process accesses the PCB, it can manipulate


critical process information.

You might also like