Assignment 2 -Operating Systems


5/5 - (2 votes)

Assignment 2
-Operating Systems Homework Assignment 2
All questions must be answered by you without outside assistance. Submission is via Canvas. You may submit either a plain text (.txt) or a PDF (.pdf) file. Succinct, concise answers to the questions are preferable to long, rambling ones. Textbook Questions (50 points) 1. OSC 4.14: A system with two dual-core processors has four processors available for scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is performed just before the program terminates, when the program results must be written to a single file. Between start-up and termination, the program is entirely CPU-bound. Your task is to improve the performance of this application by multithreading it. The application runs on a system that uses the one-to-one threading model (each user thread maps to a kernel thread). a. How many threads will you create to perform the input and output? Explain. (3 points) b. How many threads will you create for the CPU-intensive portion of the application? Explain. (3 points) 2. OSC 4.18: Consider a multicore system and a multithreaded program written using the manyto-many threading model. Let the number of user-level threads in the program be greater than the number of processing cores in the system. Discuss the performance implications of the following scenarios. (9 points) a. The number of kernel threads allocated to the program is less than the number of processing cores. b. The number of kernel threads allocated to the program is equal to the number of processing cores. c. The number of kernel threads allocated to the program is greater than the number of processing cores but is still less than the number of user-level threads. 3. OSC 6.6: Suppose that a short-term CPU scheduling algorithm favors those processes that have used the least processor time in the recent past. Why will this algorithm favor I/Obound processes and yet not permanently starve CPU-bound programs? (6 points) 4. OSC 6.11: Discuss the following pairs of scheduling criteria conflict in certain settings (9 points): a. CPU utilization and response time b. Average turnaround time and maximum waiting time c. I/O device utilization and CPU utilization
5. Real-time scheduling
CIS 415 Assignment 2
a. Rate monotonic (RM) is a well-known, fixed-priority scheduling algorithm for periodic tasks. Describe how RM works, and why it is classified as a fixed-priority algorithm. (4 points) b. You are given a set of independent, periodic tasks: T1 = (0, 4, 1), T2 = (0, 8, 2), T3 = (0, 20, 2). i. There exists a feasible schedule for these tasks using RM. Why? (4 points) ii. Assume that you are asked to add another task, T4 = (0, π, 1), such that this new system, {T1, T2, T3, T4} has a feasible schedule using RM. You must determine the value of π. A colleague asserts that π = 5 will work. Do you agree? Why or why not? (12 points)

PlaceholderAssignment 2 -Operating Systems
Open chat
Need help?
Can we help?