operating system Feb 10 2023
CS 410 Operating Systems Homework 03
All questions and problems are worth 5 pts/each unless marked otherwise.
Review Questions (4 pts/each) 3.1 (3 pts) What is an instruction trace? 3.2 What common events lead to the creation of a process? 3.4 What does it mean to preempt a process? 3.5 What is swapping and what is its purpose? 3.7 List four characteristics of a suspended process. 3.11 What are the steps performed by an OS to create a new process? 3.12 What is the difference between an interrupt and a trap? 3.13 (3 pts) Give three examples of an interrupt. 3.14 What is the difference between a mode switch and a process switch?
Problems (7 points) 3.10 In a number of early computers, an interrupt caused the register values to be stored in fixed locations associated with the given interrupt signal. Under what circumstances is this a practical technique? Explain why it is inconvenient in general.
Review Questions (4 pts/each) 4.2 (4 pts) List reasons why a mode switch between threads may be cheaper than a mode switch between processes. 4.4 Give four general examples of the use of threads in a single-user multiprocessing system. 4.5 What resources are typically shared by all of the threads of a process? 4.6 List three advantages of ULTs over KLTs. 4.7 List two disadvantages of ULTs compared to KLTs. 4.8 Define jacketing.
Problems (7 pts/each, except the last one which is 5 points) 4.1 It was pointed out that two advantages of using multiple threads within a process are that (1) less work is involved in creating a new thread within an existing process than in creating a new process, and (2) communication among threads within the same process is simplified. Is it also the case that a mode switch between two threads within the same process involves less work than a mode switch between two threads in different processes? Explain your answer.
4.2 In the discussion of ULTs versus KLTs, it was pointed out that a disadvantage of ULTs is that when a ULT executes a system call, not only is that thread blocked, but also all of the threads within the process are blocked. Why is that so?
4.4 Consider an environment in which there is a one-to-one mapping between user-level threads and kernel-level threads that allows one or more threads within a process to issue blocking system calls while other threads continue to run. Explain why this model can make multithreaded programs run faster than their single-threaded counterparts on a uniprocessor computer.
4.5 If a process exits and there are still threads of that process running, will they continue to run?
4.12 Explain the rationale for the Uninterruptible state in Linux.
SUBMISSION Submit a DOCX or PDF document through Western Online with the answers to the questions or problems typing the corresponding numbers and questions (or at least the numbers) in bold and in the proper order before your answers. Use a different font color for the numbers and questions (or at least for the numbers), than the color used for your answers.
------------///