Name of the Program: B.Sc. in SWE Semester: Winter 2020-2021 Date: 8 September 2021 Time: 2:30 pm - 4:00 pm ISLAMIC UNIVERSITY OF TECHNOLOGY (IUT) ORGANISATION OF ISLAMIC COOPERATION (OIC) Department of Computer Science and Engineering (CSE) SEMESTER FINAL EXAMINATION COURSE CODE: CSE 4501 (SWE) COURSE TITLE: OPERATING SYSTEMS WINTER SEMESTER, 2020-2021 FULL MARKS: 75 DURATION: 1 Hour 30 Minutes CSE 4501 (SWE): Operating Systems Programmable calculators are not allowed. Do not write anything on the question paper. There are total 3 (THREE) questions each with one or more sub-questions. Answer ALL of them. The symbols have their usual meanings. Figures in the right margin indicate marks and corresponding CO and PO. Write Student ID, Name and other details on top of the first page and write student ID and page no in every page of the answer script. Submission pdf of the answer script should be named as Full_Student_ID_CSE4501_Final.pdf 1. a) Write a thread program where there will be a 'control thread' that will pass one of the two commands: START and STOP to the 'processing thread'. The processing thread starts a new 'worker thread' when START command is received and signals the 'worker thread' to stop when STOP command is received. (Use POSIX thread library to implement the program. You can write the pseudo code as well. In that case pseudo code must contain POSIX thread library in it.) b) Implement the program asked in 1.a) using process and shared memory. (Use POSIX thread library to implement the program. You can write the pseudo code as well. In that case pseudo code must contain POSIX thread library in it.) c) Google's Chrome browser opens each new tab in a separate process. Would the same benefits have been achieved if Chrome opens each new tab in a separate thread? Explain your answer. 2. a) Although the Shortest Job First (SJF) algorithm is the best of all CPU scheduling algorithms yet it is not possible to implement practically. Explain why it is not possible to implement it practically. Explain the approximated implementable SJF algorithm with example. 10 CO4 PO2 10 CO4 PO2 5 CO2 P01 10 CO5 PO2 b) Suppose, the operating system maintains two different ready queues for the Interactive and Batch processes. Interactive ready queue schedules in RR manner whereas the batch queue follows FCFS policy. To balance between the queues, 80% of the time is given to the RR queue and 20% of the time is given to the FCFS queue. Draw the Gantt chart and calculate average waiting time for each of the queue for the given set of processes. Assume quantum time, q=2 unit. 10 CO5 PO1 Process Burst Time Arrival Time Type (Interactive/Batch Pl 5 0 I P2 16 3 P3 1 3 P4 8 P5 17 5 7 B I I B 3. c) A well-known company has hired you for designing a system running I/O-bound processes and CPU-bound processes. While considering different processes, you find out there is a mix of long and short processes. For better and secured performance, you have differentiated the processes to execute in the kernel-level while the rest will execute at the user-level. Now, as an OS developer, your task is to select a scheduling algorithm that will give better performance for the system. Explain your choice. a) Given memory partition of 200KB, 600KB, 200KB, 400KB and 700KB (in order), how would each of the first fit, best fit, and worst fit algorithms place for the processes of 215KB, 420KB, 115KB and 430KB (in order)? Which algorithm makes the most efficient use of memory? 5 CO5 PO2 10 CO2 PO2 b) Consider a paging system with TLB and hit ratio of 80%. If the memory access time is 150 nanoseconds and the searching time for TLB is 50 nanoseconds what is the effective memory access time for the following cases? 10 CO2 PO2 i. When the page-table entry is found in the TLB? ii. When the page-table entry is not found in the TLB? many pages are possible to be addressed in this paging scheme? If hierarchical paging is adopted c) In 32-bit addressing scheme, normally a page is constituted of 4kbytes. So, how with 10-bits for the inner page table, what will be the architecture of the memory management scheme? Draw a diagram to depict the above hierarchical paging scheme. 5 CO2 PO2