logo

Computer Scheduling and Architecture

This assessment requires students to analyze an operating system scenario, identify and understand synchronization and deadlocks, and provide options for resolving the problem and subsequent implications.

15 Pages2901 Words209 Views
   

Added on  2022-11-16

About This Document

This document explains different CPU scheduling algorithms like FCFS, SJN, SRT, Round Robin and their timelines. It also covers waiting time, turn around time, and deadlock prevention in a banking system. The resource graph is also analyzed in the document.

Computer Scheduling and Architecture

This assessment requires students to analyze an operating system scenario, identify and understand synchronization and deadlocks, and provide options for resolving the problem and subsequent implications.

   Added on 2022-11-16

ShareRelated Documents
Running head: COMPUTER SCHEDULING AND ARCHITECTURE
Computer Scheduling and Architecture
Name of the Student
Name of the University
Author Note
Computer Scheduling and Architecture_1
COMPUTER SCHEDULING AND ARCHITECTURE1
Question 1: Timelines for FCFS, SJN, SRT, Round Robin
FCFS
The simplest form of CPU scheduling algorithm is FCFS or First Come First Serve.
Through this scheduling algorithm the process that first enter the queue are get executed first
(Farooq, Shakoor & Siddique, 2017). Thus, the scheduling is non-pre-emptive. Key drawback
of this algorithm is that sometimes the process might have to wait for long periods of time.
Jobs Arrival Burst Time Completion
Time
A 0 12 12
B 2 5 17
C 4 2 19
D 6 11 30
E 9 1 31
Each of the five different processes require their own set of times to execute. The
burst times of these respective processes are given in the table above (Gupta, Yadav & Goyal,
2016). The following figure shows the gnatt chart for the processes.
Computer Scheduling and Architecture_2
COMPUTER SCHEDULING AND ARCHITECTURE2
A B C D E
0 12 17 19 30 31
SJN
SJN or Shortest Job Next, also known as Shortest Job First (SJF) refers to the
scheduling algorithm by which the process with the shortest time of execution is selected
(Chugh, 2018). This is a greedy algorithm that has the advantage of having maximum
average waiting times among the rest of the algorithms. The downside of this algorithm being
occurrence of starvation due to repeated entry of shorter processes. Such problems can be
solved through the concept of aging. This algorithm is usually not feasible as the operating
system cannot know the burst times. A few methods to help determine the execution time, for
example the weighted average of prior times of execution of the particular set of process. As
a result, SJN is only considered suited for specialized scenarios that can offer very accurate
estimates of execution times.
The algorithm can be explained in two simple steps:
1. Sort all the processes in increasing order of burst times
2. Apply the FCFS scheduling algorithm
Jobs Arrival Burst Time
A 0 12
E 9 1
C 4 2
B 2 5
D 6 11
Computer Scheduling and Architecture_3
COMPUTER SCHEDULING AND ARCHITECTURE3
The arrival times are very important. Since only 1 process is available at the start - process A,
automatically becomes the shortest process.
At time 2, process B arrives but process A is also running. Since they are not pre-empted,
therefore even if process B is shorter it needs to wait till process A completes execution.
At time 4, process C arrives which is now the shortest among the processes but process A is
yet to complete execution.
At time 6, process D arrives but process C continues to be the shortest process and process A
is still in execution.
At time 9, process E arrives and becomes the shortest process. Therefore, after time 12 when
process A finishes, process E will be executed first.
SRT
SRT or Shortest Remaining Time is the scheduling algorithm that is considered as the
pre-emptive version of shortest job next (SJN) (Almakdi, Aleisa & Alshehri, 2015). In SRT
processes having the smallest execution times are run first, similar to SJN. However, in SJN
once a process begins running, it completes execution but in SRT these running processes get
pre-empted by other processes having shorter execution times.
Jobs Arrival Burst Time
A 0 12
B 2 5
C 4 2
D 6 11
E 9 1
Computer Scheduling and Architecture_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Operating System Assessment 2022
|18
|2440
|9

CPU Scheduling Algorithms and Deadlock Situations in Computer Organization and Architecture
|12
|2773
|238

Operating Systems
|6
|749
|406

System for Deterministic Modeling of CPU Scheduling Algorithms
|7
|766
|203

Operating System Principle : Assignment
|1
|272
|136

Ans a) Gantt charts.
|3
|251
|334