Assessment 2
Assessment type: Report (2,000 words) – individual assignment
Purpose: This assessment will allow students to demonstrate that they can identify and understand synchronisation and deadlocks. This assessment contributes to learning outcomes b and c.
Value: 30% (Report 20%; Presentation 10%)
Assessment topic: Analysis of an Operating System scenario, Computer Organisation and Architecture Report
Task Details: The report will require analysis of an operating system scenario and a report on the systems and logical issues involved, as well as options for resolving the problem and subsequent implications.
Assignment Details:
1. Using either internet resources or books, understand the concept of Memory Management and Virtual Memory. Define those terms (Memory Management and Virtual Memory) in your own words.
You must provide references and cite the sources that you consulted for this task. (Harvard referencing is the required method.)
2. Given the following arrival times and CPU cycle times.
Process / Job | Priority | Arrival Time | CPU Cycles Required / Service Time |
A | 3 (Silver) | 0 | 3 |
B | 2 (Gold) | 3 | 8 |
C | 1 (Diamond) | 3 | 3 |
D | 2 (Gold) | 7 | 14 |
E | 2 (Gold) | 7 | 2 |
a. Draw a timeline (Gantt-Chart) for each of the following scheduling algorithms
b. What is the Waiting Time and Turnaround Time of each process for each of the scheduling algorithms? (Details of the calculation is essential).
3. Consider the directed resource graph shown below and answer the following questions:
In this assignment task, we will demonstrate and identify the deadlocks and synchronisation process. The assessment has three parts where we determine and analyse an operating system and some concerns related to logical issues with system. We also work on resolving the issues and identify the possible implications.
TASK – 1
Memory management – memory management is a feature of operating system that handle primary memory and return the process back, works between disk and main memory while execution of a process. It keeps track of each and every memory location either it is allocated to any process or not (free memory). Memory management decide which process and to what time a memory block is to be assign. When the memory blocks are free, it collects those and update their status. Every memory block has a process address space. It is a logical reference address code. The operating system manages the mapping of these logical address space with physical address space while allocating a memory block to a process (Operating System - Memory Management - Tutorialspoint, 2020). There are total of three types of address spaces work here, that are –
Logical addresses are the addresses that are generated by a program and the addresses referred to these logical addresses are called physical address. the main memory has two parts, as: high memory, which handles user processes and Low memory, where an operating system is resides. For memory allocation, an operating system uses these two memory allocation mechanisms –
Virtual memory – an operating system is capable to assign more memory than the installed one on the system. This additional memory is called as virtual memory. It is a part of the hard disk that is configured to use as RAM of the system. The process of translating a virtual address into physical address is called mapping. While copying virtual contents from hard disk to main memory is called swapping or paging. As the ultimate advantage of this virtual memory, a running program can use more then the physical installed memory. The virtual memory has two main advantages, as: it allows us to extend the physical memory and it protect the memory by using virtual addresses that are mapped to some physical addresses. There are so many conditions, when a program will not fully be loaded into main memory and an operating system needs virtual memory. For example, while error handling situation, program features are not in use fully, not enough number of I/O free while a process is executing, etc. (Operating System - Virtual Memory - Tutorialspoint, 2020)
The memory management unit or MMU is built into the hardware. This memory management unit works in translating virtual addresses into physical addresses. Several schemes or algorithms are used to allocate virtual memory, as demand paging, segmentation or demand segmentation. Here is the brief description of these –
TASK – 2
Given details –
Process or job | Priority | Arrival time | CPU cycle required / service time |
A | 3 (Silver) | 0 | 3 |
B | 2 (Gold) | 3 | 8 |
C | 1 (Diamond) | 3 | 3 |
D | 2 (Gold) | 7 | 14 |
E | 2 (Gold) | 7 | 2 |
Here are the waiting time and turnaround time of each processes, responding to each scheduling algorithm –
The Formula to Calculate the Turnaround Time = Completion Time – Arrival Time.
The Formula to Calculate the Waiting Time = Turnaround Time – Service Time.
(ProQuest Ebook Central, 2020)
i) Feedback (FB) q=3
This algorithm is somehow similar to MLQ scheduling algorithm but it can move between the process queues. It analyses the behaviour of the processes and according to change their priority.
Process / Job | Arrival Time | Service Time | Completion Time | Turnaround Time | Waiting Time |
A | 0 | 3 | 3 | 3 | 0 |
B | 3 | 8 | 11 | 8 | 0 |
C | 3 | 3 | 14 | 11 | 8 |
D | 7 | 14 | 28 | 21 | 7 |
E | 7 | 2 | 30 | 23 | 21 |
Chart for Feedback q = 3 –
A | B | C | D | E |
0 3 11 14 28 30
Calculation steps –
ii) Highest Respond Ratio Next (HRRN)
It is one of the most optimal scheduling algorithms which works on non-primitive algorithm for scheduling purposes. It determines scheduling based on response ratio. So, we need to have a response time for every process and a priority order of the jobs. To calculate response ration, we use the below formula –
RR = (W+S)/S
Process / Job | Arrival Time | Service Time | Completion Time | Turnaround Time | Waiting Time |
A | 0 | 3 | 3 | 3 | 0 |
B | 3 | 8 | 14 | 11 | 3 |
C | 3 | 3 | 6 | 3 | 0 |
D | 7 | 14 | 30 | 23 | 9 |
E | 7 | 2 | 16 | 9 | 7 |
Chart for HRRN –
A | B | C | E | D |
0 3 6 14 16 30
Calculation steps –
iii) Round Robin (RR) q=4
This algorithm also works as primitive algorithm. Every process in the round robin scheduling, is assigned a fix execution time. Once the execution of process starts, it pre-empted and another process will start within a given time. To save process state, context switching method is used.
Process / Job | Arrival Time | Service Time | Completion Time | Turnaround Time | Waiting Time |
A | 0 | 3 | 3 | 3 | 0 |
B | 3 | 8 | 20 | 17 | 9 |
C | 3 | 3 | 6 | 3 | 0 |
D | 7 | 14 | 30 | 23 | 9 |
E | 7 | 2 | 16 | 9 | 7 |
Chart for RR –
A | C | B | D | E | B | D |
0 3 6 10 14 16 20 30
Calculation steps –
iv) Shortest Remaining Time (SRT)
SRT is a primitive version of SJF scheduling algorithm. In SRT algorithm, process execution is stopped after a certain time period. When a new process has arrived, SRT schedule the process with least burst time, from the process queue.
Process / Job | Arrival Time | Service Time | Completion Time | Turnaround Time | Waiting Time |
A | 0 | 3 | 3 | 3 | 0 |
B | 3 | 8 | 16 | 13 | 5 |
C | 3 | 3 | 6 | 3 | 0 |
D | 7 | 14 | 30 | 23 | 9 |
E | 7 | 2 | 9 | 2 | 0 |
Chart for SRT –
A | C | B | E | B | D |
0 3 6 7 9 16 30
Calculation steps –
v. Shortest Process Next (SPN)
This algorithm works by sorting all the processes by their arrival time. Then select a process which has min arrival time and min burst time. Here are the details of the whole process.
Process / Job | Arrival Time | Service Time | Completion Time | Turnaround Time | Waiting Time |
A | 0 | 3 | 3 | 3 | 0 |
B | 3 | 8 | 14 | 11 | 3 |
C | 3 | 3 | 6 | 3 | 0 |
D | 7 | 14 | 30 | 23 | 9 |
E | 7 | 2 | 16 | 9 | 7 |
Chart for SPN –
A | C | B | E | D |
0 3 6 14 16 30
Calculation steps –
TASK – 3
Answer to the question based on the provided resource graph:
a. Is the system deadlocked?
Ans. – Yes, the system is deadlocked.
b. Which, if any, processes are blocked?
Ans. – the P3 process is blocked here.
c. What is the resulting graph after reduction?
Ans. – here is the resulting graph after reduction –
Figure: resulted graph after reduction
Details of calculation – in the provided resource graph, a resources R1 and R2 are assigned to process P2 while the resource R2 is used by process P1 and depends on resources R1. The process P3 uses resource R2 but depends on resources R3, R4 and R5. When the process P1 starts, it uses R1 but also depends on R2. When process P2 starts, it uses R3 but depends on R1 and R2 to free up. Till time it starts its work, R1 and R2 will be freed and no deadlock is created. When process P3 starts, it uses R2 that is already in use by P2. P3 is also depend on R3, R4 and R5. Here process P3 creates a deadlock when it didn’t get the required resources to complete the process.