Download CSE 120 Midterm Review: Operating Systems Concepts - Prof. Geoffrey M. Voelker and more Study notes Computer Science in PDF only on Docsity! 1 Midterm Review Geoffrey M. Voelker October 25, 2000 CSE 120 – Midterm Review 2 The midterm Architectural support for OSes OS modules, interfaces, and structures Processes Threads Synchronization Scheduling 2 October 25, 2000 CSE 120 – Midterm Review 3 Covers material through scheduling Based upon lecture material, homeworks, and project Open book, open notes Please, do not cheat Do not copy from your neighbor. I will notice No one involved will be happy, including me October 25, 2000 CSE 120 – Midterm Review 4 Types of architecture support Manipulating privileged machine state Generating and handling events 5 October 25, 2000 CSE 120 – Midterm Review 9 How are the components organized? Monolithic kernels Layering Microkernels What are the advantages and disadvantages of each? October 25, 2000 CSE 120 – Midterm Review 10 What is a process? What resource does it virtualize? What is the difference between a process and a program? What is contained in a process? 6 October 25, 2000 CSE 120 – Midterm Review 11 # Process Control Blocks (PCBs) What information does it contain? How is it used in a context switch? State queues What are process states? What is the process state graph? When does a process change state? How does the OS use queues to keep track of processes? October 25, 2000 CSE 120 – Midterm Review 12 What does CreateProcess on NT do? What does fork() on Unix do? What does it mean for it to “return twice”? What does exec() on Unix do? How is it different from fork? How are fork and exec used to implement shells? 7 October 25, 2000 CSE 120 – Midterm Review 13 $ What is a thread? What is the difference between a thread and a process? How are they related? Why are threads useful? What is the difference between user-level and kernel- level threads? What are the advantages/disadvantages of one over another? October 25, 2000 CSE 120 – Midterm Review 14 $ ! How are threads managed by the run-time system? Thread control blocks, thread queues How is this different from process management? What operations do threads support? Fork, yield, sleep, etc. What does thread yield do? What is a context switch? What is the difference between non-preemptive scheduling and preemptive thread scheduling? Voluntary and involuntary context switches 10 October 25, 2000 CSE 120 – Midterm Review 19 What is a monitor? Shared data Procedures Synchronization In what way does a monitor provide mutual exclusion? To what extent is it provided? How does a monitor differ from a semaphore? How does a monitor differ from a lock? What kind of support do monitors require? Language, run-time support October 25, 2000 CSE 120 – Midterm Review 20 ) * What is a condition variable used for? Coordinating the execution of threads Not mutual exclusion Operations What are the semantics of Wait? What are the semantics of Signal? What are the semantics of Broadcast? How are condition variables different from semaphores? 11 October 25, 2000 CSE 120 – Midterm Review 21 ! What does the implementation of a monitor look like? Shared data Procedures A lock for mutual exclusion to procedures (w/ a queue) Queues for the condition variables What is the difference between Hoare and Mesa monitors? Semantics of signal (whether the woken up waiter gets to run immediately or not) What are their tradeoffs? October 25, 2000 CSE 120 – Midterm Review 22 ' ( ) In Nachos, we don’t have monitors But we want to be able to use condition variables So we isolate condition variables and make them independent (not associated with a monitor) Instead, we have to associate them with a lock (mutex) Now, to use a condition variable… Threads must first acquire the lock (mutex) CV::Wait releases the lock before blocking, acquires it after waking up 12 October 25, 2000 CSE 120 – Midterm Review 23 What kinds of scheduling is there? Long-term scheduling Short-term scheduling Components Scheduler (dispatcher) When does scheduling happen? Job changes state (e.g., waiting to running) Interrupt, exception Job creation, termination October 25, 2000 CSE 120 – Midterm Review 24 + Goals Maximize CPU utilization Maximize job throughput Minimize turnaround time Minimize waiting time Minimize response time What is the goal of a batch system? What is the goal of an interactive system?