Unformatted text preview:

Project 1 Due at Midnight Lecture 9 Midterm Review CSE 120 Principles of Operating Systems Alex C Snoeren Midterm Everything we ve covered is fair game Exam will be individual closed book Readings lectures homework and Nachos Yes there may be Nachos code on the exam Leave books notes laptops etc at home or in your bag We ll provide scrap paper should you need it Please don t cheat none of us will enjoy the results Barath will proctor the exam Tuesday Please sit every other seat when you arrive 2 CSE 120 Lecture 9 Topics We ve Covered OS modules interfaces and structures Architectural support for OSes Processes Threads Locks Semaphores Monitors Condition Variables Scheduling Deadlock 3 CSE 120 Lecture 9 OS Modules and Interfaces Modules OS services and abstractions Interfaces Operations supported by components 4 CSE 120 Lecture 9 Modules Processes Memory I O Secondary storage Files Protection Account Command interpreter shell 5 CSE 120 Lecture 9 Arch Support for OSes Types of architecture support Manipulating privileged machine state Generating and handling events 6 CSE 120 Lecture 9 Privileged Instructions What are privileged instructions 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 Protected control registers Memory management I O devices 7 CSE 120 Lecture 9 Events Events 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 Synchronous fault exceptions system calls Asynchronous interrupts software interrupt How do I O devices use interrupts What is the difference between exceptions and interrupts 8 CSE 120 Lecture 9 Processes 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 9 CSE 120 Lecture 9 Process Data Structures 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 10 CSE 120 Lecture 9 Process Manipulation What does CreateProcess on NT do What does fork on Unix do What does exec on Unix do What does it mean for it to return twice How is it different from fork Why separate fork and exec 11 CSE 120 Lecture 9 Threads 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 kernellevel threads What are the advantages disadvantages of one over another 12 CSE 120 Lecture 9 Thread Implementation How are threads managed by the run time system What operations do threads support Thread control blocks thread queues How is this different from process management 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 13 CSE 120 Lecture 9 Synchronization Why do we need synchronization What can happen to shared data structures if synchronization is not used Coordinate access to shared data structures Coordinate thread process execution Race condition Corruption Bank account example When are resources shared Global variables static objects Heap objects 14 CSE 120 Lecture 9 Mutual Exclusion What is mutual exclusion What is a critical section What guarantees do critical sections provide What are the requirements of critical sections Mutual exclusion Progress Bounded waiting no starvation Performance How does mutual exclusion relate to critical sections What are the mechanisms for building critical sections Locks semaphores monitors condition variables 15 CSE 120 Lecture 9 Locks 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 test and set work Spinlocks Disable enable interrupts Blocking Nachos What kind of lock does it implement What are the limitations of using spinlocks interrupts Inefficient interrupts turned off too long 16 CSE 120 Lecture 9 Semaphores What is a semaphore What does Wait P Decrement do What does Signal V Increment do How does a semaphore differ from a spin lock What is the difference between a binary semaphore and a counting semaphore When do threads block on semaphores When are they woken up again Using semaphores to solve synchronization problems Readers Writers problem Bounded Buffers problem 17 CSE 120 Lecture 9 Monitors What is a monitor In what way does a monitor provide mutual exclusion Shared data Procedures Synchronization 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 18 CSE 120 Lecture 9 Condition Variables What is a condition variable used for Operations 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 19 CSE 120 Lecture 9 Implementing Monitors 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 20 CSE 120 Lecture 9 Locks and Condition Vars 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 21 CSE 120 Lecture 9 Scheduling What kinds of scheduling is there Components Long term scheduling Short term scheduling Scheduler dispatcher When does scheduling happen Job changes state e g waiting to running Interrupt exception Job creation termination 22 CSE 120 Lecture 9 Scheduling Goals 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 23


View Full Document

UCSD CSE 120 - Midterm Review

Documents in this Course
Threads

Threads

14 pages

Deadlocks

Deadlocks

19 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Processes

Processes

18 pages

Threads

Threads

29 pages

Security

Security

16 pages

Paging

Paging

13 pages

Processes

Processes

32 pages

Lecture 2

Lecture 2

13 pages

Paging

Paging

8 pages

Threads

Threads

14 pages

Paging

Paging

13 pages

Paging

Paging

26 pages

Paging

Paging

13 pages

Lecture

Lecture

13 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Security

Security

17 pages

Threads

Threads

15 pages

Processes

Processes

34 pages

Structure

Structure

10 pages

Lecture 3

Lecture 3

13 pages

Lecture 1

Lecture 1

28 pages

Threads

Threads

15 pages

Paging

Paging

30 pages

Load more
Loading Unlocking...
Login

Join to view Midterm Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Midterm Review and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?