8 Pages

midReview

Course: CSE 120, Spring 2012
School: UCSD
Rating:
 
 
 
 
 

Word Count: 1208

Document Preview

of Overview CSE120 Principles Operating Systems Prof Yuanyuan (YY) Zhou Midterm Review Oct 19th , 2010 The midterm Architectural support for OSes OS modules, interfaces, and structures Processes Threads Synchronization Scheduling Deadlock 2 10/19/2010 Midterm Arch Support for OSes Covers material through scheduling Based upon lecture material, optional homeworks, and projects No cheat sheets...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> UCSD >> CSE 120

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
of Overview CSE120 Principles Operating Systems Prof Yuanyuan (YY) Zhou Midterm Review Oct 19th , 2010 The midterm Architectural support for OSes OS modules, interfaces, and structures Processes Threads Synchronization Scheduling Deadlock 2 10/19/2010 Midterm Arch Support for OSes Covers material through scheduling Based upon lecture material, optional homeworks, and projects No cheat sheets Please, do not cheat Types of architecture support Manipulating privileged machine state Generating and handling events Events: Interrupts, exceptions, system calls, etc Do not copy from your neighbor No one involved will be happy, particularly the teaching staff 3 CSE 120 Midterm Review You will be noticed 10/19/2010 CSE 120 Midterm Review 4 10/19/2010 CSE 120 Midterm Review 1 Privileged Instructions What are privileged instructions? Events Who gets to execute them? How does the CPU know whether they can be executed? Difference between user and kernel mode Why do they need to be privileged? What do they manipulate? 10/19/2010 CSE 120 Midterm Review 6 OS services and abstractions Interfaces Operations supported by components 7 10/19/2010 CSE 120 Midterm Review What is the difference between exceptions and interrupts? CSE 120 Midterm Review Modules Modules How do I/O devices use interrupts? 10/19/2010 OS Modules and Interfaces Synchronous: fault (exceptions), system calls Asynchronous: interrupts, software interrupt What are faults, and how are they handled? What are system calls, and how are they handled? What are interrupts, and how are they handled? Protected control registers Memory management I/O devices 5 Events 8 Processors Memory I/O Secondary storage Files Protection Account Command interpreter (shell) 10/19/2010 CSE 120 Midterm Review 2 Processes Process Data Structures What is a process? What is the difference between a process and a program? What is contained in a process? Process Control Blocks (PCBs) State queues 9 10/19/2010 CSE 120 Midterm Review What information does it contain? How is it used in a context switch? 10 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? 10/19/2010 Process Manipulation What does it mean for it to return twice? What is a thread? What does exec() on Unix do? Threads What does fork() on Unix do? How is it different from fork? How are fork and exec used to implement shells? 10/19/2010 CSE 120 Midterm Review 12 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? 11 CSE 120 Midterm Review What are the advantages/disadvantages of one over another? 10/19/2010 CSE 120 Midterm Review 3 Thread Implementation How are threads managed by the run-time system? Thread control blocks, thread queues How is this different from process management? Fork, yield, sleep, etc. What does thread yield do? 13 10/19/2010 CSE 120 Midterm Review 14 What guarantees do critical sections provide? What are the requirements of critical sections? Mutual exclusion (safety) Progress (liveness) Bounded waiting (no starvation: liveness) Performance What does Acquire do? What does Release do? What does it mean for Acquire/Release to be atomic? How can locks be implemented? How does mutual exclusion relate to critical sections? What are the mechanisms for building critical sections? How does test-and-set/swap work? What are the limitations of using spinlocks, interrupts? Locks, semaphores, monitors, condition variables 10/19/2010 CSE 120 Midterm Review Spinlocks Disable/enable interrupts Blocking (Nachos) 15 CSE 120 Midterm Review Locks What is mutual exclusion? What is a critical section? Global variables, static objects Heap objects 10/19/2010 Mutual Exclusion Race condition Corruption Bank account example When are resources shared? Voluntary and involuntary context switches Coordinate access to shared data structures Coordinate thread/process execution What can happen to shared data structures if synchronization is not used? What is a context switch? What is the difference between non-preemptive scheduling and preemptive scheduling? Why thread do we need synchronization? What operations do threads support? Synchronization 16 What kind of lock does it implement? Inefficient, interrupts turned off too long 10/19/2010 CSE 120 Midterm Review 4 Semaphores What is a semaphore? Monitors What does P/Decrement do? What does V/Increment do? How does a semaphore differ from a lock? What is the difference between a binary semaphore and a counting semaphore? In what way does a monitor provide mutual exclusion? How does a monitor differ from a semaphore? How does a monitor differ from a lock? What kind of support do monitors require? Readers/Writers problem Bounded Buffers problem 17 10/19/2010 CSE 120 Midterm Review 18 Coordinating the execution of threads Not mutual exclusion 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? 10/19/2010 CSE 120 Midterm Review 20 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? 19 CSE 120 Midterm Review What does the implementation of a monitor look like? Operations Language, run-time support Implementing Monitors What is a condition variable used for? To what extent is it provided? 10/19/2010 Condition Variables Shared data Procedures Synchronization When do threads block on semaphores? When are they woken up again? Using semaphores to solve synchronization problems What is a monitor? Semantics of signal (whether the woken up waiter gets to run immediately or not) What are their tradeoffs? What does Java provide? 10/19/2010 CSE 120 Midterm Review 5 Locks and Condition Vars Scheduling In Nachos, we dont 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 Components When does scheduling happen? Scheduler (dispatcher) Job changes state (e.g., waiting to running) Interrupt, exception Job creation, termination Threads must first acquire the lock (mutex) CV::Wait releases the lock before blocking, acquires it after waking up 21 10/19/2010 CSE 120 Midterm Review 22 10/19/2010 Scheduling Goals 23 Starvation Goals CSE 120 Midterm Review Maximize CPU utilization Maximize job throughput Minimize turnaround time Minimize waiting time Minimize response time Starvation Causes Indefinite denial of a resource (CPU, lock) Side effect of scheduling Side effect of synchronization Operating systems try to prevent starvation What is the goal of a batch system? What is the goal of an interactive system? 10/19/2010 CSE 120 Midterm Review 24 10/19/2010 CSE 120 Midterm Review 6 Scheduling Algorithms What are the properties, advantages and disadvantages of the following scheduling algorithms? 25 Deadlock First Come First Serve (FCFS)/First In First Out (FIFO) Shortest Job First (SJF) /shortest remaining time first Priority Round Robin Multilevel feedback queues What scheduling algorithm does Unix use? Why? 10/19/2010 CSE 120 Midterm Review 26 27 int x = 0; int i, j; Ignore it Prevent it (prevent one of the four conditions) Avoid it (have tight control over resource allocation) Detect and recover from it void AddToX() { for (i = 0; i < 100; i++) x++; } void SubFromX() { for (j = 0; j < 100; j++) x--; } Which of the four approaches above does it implement? How does it compute whether an allocation is safe? 10/19/2010 CSE 120 Midterm Review CSE 120 Midterm Review A fun problem: Race Conditions What is the Bankers algorithm? Resource allocation graph (RAG) Waits for graph (WFG) 10/19/2010 Dealing with deadlock Mutual exclusion Hold and wait No preemption Circular wait How to visualize, represent abstractly? Deadlock Approaches Deadlock happens when processes are waiting on each other and cannot make progress What are the conditions for deadlock? 28 One thread does addition, and the other thread does subtraction What is the range of possible values for x? Why? 10/19/2010 CSE 120 Midterm Review 7 Good Luck 29 10/19/2010 CSE 120 Midterm Review 8
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

UCSD - CSE - 120
CSE120 Midterm Exam Fall 2010Name:_University of California, San DiegoDepartment of Computer Science of EngineeringMidterm Examination 1CSE120 Operating System PrincipalsSpring, 20119:30-10:50am, May 2ndPrint your name and ID number neatly in the
UCSD - CSE - 120
CSE 120 Optional Exercises Solutions.1) b2) b3) c4) b5) c6) First p1 is used to lookup the entry in the primary page table. This entry contains theaddress for the secondary page table. Then p2 is used to lookup the entry in the secondary pagetable
UCSD - CSE - 202
Algorithms - CSE 202Mathematical Preliminaries and Introductory ProblemsWriting Style: We suggest the following steps in writing up your solutions, when they are applicable. For a detailedwriting style guidelines, please consult http:/cseweb.ucsd.edu/
UCSD - CSE - 202
Stable Marriage ProblemProblem 1: Determining all stable matchingsEnumerate all the stable matchings for the four men and four women with the following preference lists.m1m2m3m4:w3:w3:w4:w2&gt; w1&gt; w2&gt; w3&gt; w4w1w2w3w4:m2:m2:m4:m1&gt; w4&gt;
UCSD - CSE - 202
CSE 202 Final ExaminationDecember 2011Maximum points: 60Due December 8th, 5:00 PM. Submit the solutions at CSE 4246. No late submissions. No electronic submissions.Instructions:1. Although this exam is an open book exam, you are only allowed to consu
UCSD - CSE - 202
CSE 202 Homework 1 Solutions1 Kleinberg &amp; Tardos, problem 4, page 247. Coulomb forces among charged particles.LetQ = (q1 , . . . , qn , 0, . . . , 0)n1111111, . . . , 2 , 2 , 0, 2 , 2 , . . . ,).P = (2(n 1)2112(n 1)2Both vectors have 2n
UCSD - CSE - 202
CSE 202 Homework 2 Solutions1 Kleinberg &amp; Tardos, problem 26, page 202. Time-varying Minimum Spanning Tree. Connected graph G = (V, E ). Each edge e E has a time-varying edge cost fe = ae t2 + be t + ce such that fe &gt; 0 for all t. Denote n = |V | and
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - ECE - 438
University of Texas - MATH - 340L
M340L:Matrices and Matrix CalculationsUnique Number: 57160Practice Final , April, 2006I dont know how much of chapter 6 will be studied by the end of next week. Thisalready gives an idea of what might be the main part of your nal, but expect a proble
University of Texas - MATH - 340L
Matrices and Matrix CalculationsSpring 06, Unique Number:Practice TEST # 2Problem 1. What is a basis for a1We consider the matrix B = 53subspace? (give a denition) (5 points)237 9 . Determine if the columns of B provide3423 1 in this basis. (
University of Texas - MATH - 340L
M340L:Matrices and Matrix CalculationsUnique Number: 57160PRACTICE FIRST TEST, February, 2006- Calculators are authorized. No other document is authorized neither book nor handwritten notes.- Show all of your work.- Justify every answer, either by
University of Texas - MATH - 340L
M340L:Matrices and Matrix CalculationsUnique Number: 57160Practice Final sketchy Solution, May , 2006LAST NAME (PRINT).First Name .-Calculators are authorized. Books, hand written notes or other documentsare not authorized.- Show all your work.-
University of Texas - MATH - 427K
Math 427K Exam 2Name:UT EID:Instructions Please put your name and UT EID in the space provided. There are 4 questions each worth 10 points. You have 50 minutes to complete the test. Please write your working and solutions on the test paper. You may
University of Texas - MATH - 427K
Math 427K Exam 3Name:UT EID:Instructions Please put your name and UT EID in the space provided. There are 4 questions each worth 10 points. You have 50 minutes to complete the test. Please write your working and solutions on the test paper. You may
UC Davis - MCB - 121
Study Questions Lecture 13/14 Transcriptional regulation*Question 1 (MBOG 7-27) Many gene regulatory proteins form dimers of identical or slightlydifferent subunits on the DNA . Suggest two advantages of dimerization.There are at least two advantages o
UC Davis - MCB - 121
Study questions Lecture 17 Translation mechanisms and regulationQuestion 1. (a) Which of the following is a feature of expression of protein coding genes in bothbacteria and higher eukaryotes?_ Introns are spliced from the RNA prior to translation._mR
UC Davis - MCB - 121
Study questions Lecture 18 KEY Regulatory RNAQuestion 1. You have developed a computer algorithm to identify RNA secondary structurewithin intron sequences in mammalian cells. You find a sequence you predict would fold into amiRNA precursor in a gene c
UC Davis - MCB - 121
Study Questions Lectures 14/15 Transcription and chromatin structureQuestion 1 For each of the following circle the T if the statement is true and the F if thestatement is false.TFChanges in chromatin structure that result in changes in ge ne express
UC Davis - MCB - 121
Study Questions Lectures 15/16 RNA processing and splicingQuestion 1. Radiolabeled pre-mRNA has been incubated with nuclear extract and ATP to carryout an in vitro splicing reaction. Three different precursors are used. The first (1)contains a mutation
Liberty - HIST - 101
Cotton Candy Pink &amp; BluePink and blue lollipopsDanish wedding cookiesPersonalized napkinsHop on Pop cornMoose JuiceGoose JuiceGreen EggsHamRed fish, blue fishPoodles with Noodles
CSU Chico - CSC - 138
Why network layer?Network layer role is to move packets from sending host to a receiving host. transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer
CSU Chico - CSC - 138
Why link layer?a protocol in the link layer (layer 2) provides services to the protocols in the network layer (layer3). The most basic service of any link-layer protocol is to move a datagram from one node to anadjacent node over a single communication
CSU Chico - CSC - 138
Wireless and Mobile NetworksWhich layer?Layer 2 data link layerWireless network architecturewireless hosts laptop, PDA, IP phone run applications may be stationary (non-mobile) or mobileo wireless does not always mean mobilitybase station typica
CSU Chico - CSC - 138
EEE174 CpE185 LaboratoryF201Arduino Inventors (AIK) LabPart 1: Circuits 1 - 4:In this section, you will begin familiarizing yourself with the Arduino microcontrollerboth hardware and software. You will setup and test the Arduino Inventors Kit (AIK).
CSU Chico - CSC - 138
Chapter2ApplicationLayerA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide content to s
CSU Chico - CSC - 138
Chapter3TransportLayerA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide content to sui
CSU Chico - CSC - 138
Chapter4NetworkLayerA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide content to suit
CSU Chico - CSC - 138
Chapter5LinkLayerandLANsA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide content to s
CSU Chico - CSC - 138
Chapter6WirelessandMobileNetworksA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide con
CSU Chico - CSC - 138
Chapter8NetworkSecurityA note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).Theyre in PowerPoint form so you can add, modify, and delete slides(including this one) and slide content to su
CSU Chico - EEE - 174
187
CSU Chico - EEE - 174
a100MOV DX,0120MOV AX,[0200]MOV BX,[0202]SUB AX,BXJGE 0114ADD AX,DXJGE 0114JMP 010EMOV [0200],AXINT 20;;;;;;;;;;establish base offset value of 120 in DX regget stored signal value location 200 and put into reg AXget raw signal value
CSU Chico - EEE - 174
EEE174 - CpE185 Hand Assembly LabDahlquist123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960Register Memorynot used LocationA220
CSU Chico - EEE - 174
Dennis DahlquistStart SimpleBanking ProgramLab 1 Banking ProgramFlow ChartEstablish OverdraftAmount$120Mov DX, 0120Get CurrentBalance Amountfrom memoryMov AX, [0200]Get Check Amountfrom memoryMov BX, [0202]Subtract Checkamout from Current
CSU Chico - EEE - 174
Hand Assembly Instruction HandoutMode (mod) field encodingMod00011011ExplanationMemory Mode, no displacement followsexcept when r/m = 110, then 16-bitdisplacement follows.Memory mode, 8-bit displacementfollowsMemory mode, 16-bit displacement
CSU Chico - EEE - 174
EEE 174Laboratory Hand-Assembly TemplateDahlquist/Stoffers/SchultzInstruction:Address:CS:Operation:Dest.:Source::Operation:Dest.:Source::Operation:Dest.:Source::Operation:Dest.:Source::Operation:Dest.:Source::Operation:Dest.:S
CSU Chico - EEE - 174
CSU Chico - EEE - 174
CSU Chico - EEE - 174
Computer Software EngineeringComputerSpring 2011Lecture # 7Object oriented DesignObjectUML Interaction Diagrams(Sequence, Collaboration and State ChartDiagrams)Sequence Diagram A sequence diagram provides a detailed view of asequenceuse case.
CSU Chico - EEE - 174
CSc 131CScComputer Software EngineeringSpring 2011Software DesignSoftwareDesign Concepts and PrinciplesDesignSoftware DesignSoftware Goal: To produce a model or representationTothat will later be builtthat Software design is the first of th
CSU Chico - EEE - 174
MASM Set upSet path:C:\MASM615\BIN;C:\MASM615\INCLUDE;C:\MASM615\LIB;C:\MASM615\INIT;C:\MASM615\HELPClick &quot;OK&quot; and re-boot if needed.MASM is now ready to run.Make sure to set up a project, see PWB set up.
CSU Chico - EEE - 174
EEE174 CpE185 LaboratorySpring 2012MicroChip PICkit3 LabPart 1: Introduction to the PICkit3 PIC18 microcontroller:In this section, you will begin familiarizing yourself with the Propeller microcontroller both hardwareand software. You will setup and
CSU Chico - EEE - 174
PICkit 3Programmer/DebuggerUsers Guide 2009 Microchip Technology Inc.DS51795ANote the following details of the code protection feature on Microchip devices:Microchip products meet the specification contained in their particular Microchip Data Sheet.
CSU Chico - EEE - 174
CSU Chico - EEE - 174
EEE174 CpE185 LaboratoryF201Propeller LabPart 1: Introduction to the Propeller microcontroller:In this section, you will begin familiarizing yourself with the Propeller microcontroller both hardwareand software. You will setup and test the propeller
CSU Chico - EEE - 174
EEE174 CpE185 LaboratoryFall 2011Propeller LabPart 1: Introduction to the Propeller microcontroller:In this section, you will begin familiarizing yourself with the Propeller microcontroller both hardwareand software. You will setup and test the prope
CSU Chico - EEE - 174
CSU Chico - EEE - 174
CSC 131Computer Software EngineeringSpring 2011Software TestingFall 2005Period. 19561957 19781979 19821983 19871988 - .ClassificationThe Debugging Oriented periodThe Demonstration-Oriented periodThe Destruction-Oriented periodThe Evaluation
CSU Chico - EEE - 174
EEE 174Laboratory Exercise #1Name:Program Tracing ChartRegisters:AX:Value:-&gt;BX:CX:DX:OF:ZF:SF:CS:IP:DS:200DS:202Next Instruction:EEE 174Laboratory Exercise #1Name:ExampleIP:DS:200Program Tracing ChartRegisters:AX:Value:-&gt;BX:00
CSU Chico - EEE - 174
x86 and C refresher LabBackground:The x86 is a very widely used microprocessor, it is in Windows and Macintoshpersonal computers. It is important to be familiar with Intel Architecture, IA.In this lab we will be come familiar with the Intel Architectu
Chadron State College - MGMT - 620
Week 7 - Assignment 2Leadership Case StudyDustin TaylorChadron State CollegeMGMT 620 High Performance LeadershipTurning the Company AroundEach of the three divisions of the company seem to have both their upsides and theirdownsides. I think each of
Texas San Antonio - IS - 3003
Chapter 1 NotesFunctionalmanagerA manager who is responsible for a department that performs a single functionaltask and has employees with similar training and skills.generalmanagerA manager who is responsible for several departments that perform d
Purdue - STAT - 350
STAT350FinalSpring 2007(12 pts) 1. Multiple choice. No work needs to be shown here, you will not receivepartial credit.(i) Correlation coecient r between two variables x and y has the same meaning as theregression slope between x and y .(a) True(b
Purdue - STAT - 350
Example:For a certain statistics course, data for students scores on Exam 1 are used to try to predict students scoreson Exam 2.1. What is the estimated least squares regression line?y_hat = -4.85586 + 0.96325x2. Is there a linear relationship betwee
Purdue - STAT - 350
The examples below are not meant to be all inclusive but examples of certain type of problems youmight expect in the final exam. For a complete list, see the lecture notes, homework, and all labs.Example:For a certain statistics course, data for studen