Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 This question is about Processes, Memory management & Scheduling. (a) The program shown below is compiled and run on a UNIX machine. Predict

image text in transcribed
image text in transcribed
Question 3 This question is about Processes, Memory management & Scheduling. (a) The program shown below is compiled and run on a UNIX machine. Predict all possible outputs that this program will print to the console and explain your answer. 1 #include 2 #include 3 #include 4 #include Cunistd.h> 5 int main() { 6 int x - 1; 7 pidt pid - fork(); 8 if (pid - 0) { 9 X-X. 2: 10 } else if (pid > 0) { 11 wait (NULL); 12 13 ) 14 printf("%d ",x); 15 ) (4 marks] (b) Schedule the processes (given in Table 1) using round robin scheduling with quantum 10. Also, calculate the total turnaround time. [5 marks] PO Table 1. Process table ID Arrival Time Duration 3 20 P1 15 22 P2 0 32 P3 5 3 P4 49 29 (c) What are the physical memory addresses for each of the following logical addresses for the segment table (Table 2)? Note any that are invalid. The logical addresses are: 03.15 (6) 0.512 (i) 1, 4096 (iv) 0.1 [4 marks] Table 2: Segment table Segment Base Address Length 0 16384 400 1 4096 4096 2 32768 810 3 20480 1024 (d) Consider a system with four frames of memory, and the following sequence of page accesses: 0,1.2.3.4.2.3.0.1.4.2. When do page faults occur using FIFO and LRU replacement algorithms? Briefly justify your answer. [4 marks] (e) Consider a demand-paged computer system which was recently measured to deter- mine the utilisation of CPU and the paging disk to decide the degree of multipro- gramming. The results are shown in the figure below. Explain what is happening in each scenario and what actions an operating system can take. Scenario 1 Scenario 2 Scenario 3 0 80 20 40 60 *CPU utilisation Disk utilisation 100 [3 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago