1 Exam Feedback Dave Eckhardt

Slides:



Advertisements
Similar presentations
1 Chapter 5 Concurrency: Mutual Exclusion and Synchronization Principals of Concurrency Mutual Exclusion: Hardware Support Semaphores Readers/Writers Problem.
Advertisements

1 Deadlock Solutions: Avoidance, Detection, and Recovery CS 241 March 30, 2012 University of Illinois.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
Chapter 6: Process Synchronization
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
CS 162 Discussion Section Week 4 9/ /4. Today’s Section ●Project administrivia ●Quiz ●Lecture Review ●Worksheet and Discussion.
15-410, F’ Exam #1 Oct. 25, 2004 Dave Eckhardt L21_Exam “...What does BSS stand for, anyway?...”
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
CS444/CS544 Operating Systems Introduction to Synchronization 2/07/2007 Prof. Searleman
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
CS444/CS544 Operating Systems Synchronization 2/16/2006 Prof. Searleman
Deadlocks Vivek Pai / Kai Li Princeton University.
CS 104 Introduction to Computer Science and Graphics Problems
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Process Synchronization.
Intro to OS CUCS Mossé Processes and Threads What is a process? What is a thread? What types? A program has one or more locus of execution. Each execution.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
CS252: Systems Programming Ninghui Li Final Exam Review.
Exam Review Operating Systems CS 550. Items of Interest Exam is Nov. 19, 2014 Focus on material since last exam, though knowledge of initial material.
CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:
Exam2 Review Bernard Chen Spring Deadlock Example semaphores A and B, initialized to 1 P0 P1 wait (A); wait(B) wait (B); wait(A)
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Mutual Exclusion.
1 Concurrency: Mutual Exclusion and Synchronization Module 2.2.
Cpr E 308 Spring 2004 Real-time Scheduling Provide time guarantees Upper bound on response times –Programmer’s job! –Every level of the system Soft versus.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
1 Chapter 2.3 : Interprocess Communication Process concept  Process concept  Process scheduling  Process scheduling  Interprocess communication Interprocess.
CSE 451: Operating Systems Section 5 Midterm review.
Kernel Locking Techniques by Robert Love presented by Scott Price.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 11: October 5, 2010 Instructor: Bhuvan Urgaonkar.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
Exam Review Andy Wang Operating Systems COP 4610 / CGS 5765.
Operating Systems CSE 411 CPU Management Dec Lecture Instructor: Bhuvan Urgaonkar.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
1 Feedback Dave Eckhardt 1 Homework Q2 ● Was deadlock prevention an option for P2? ● Answer – We couldn't violate the “mutual exclusion”
CE Operating Systems Lecture 8 Process Scheduling continued and an introduction to process synchronisation.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
Introduction to operating systems What is an operating system? An operating system is a program that, from a programmer’s perspective, adds a variety of.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Process Management Deadlocks.
Operating systems Deadlocks.
Sarah Diesburg Operating Systems COP 4610
Background on the need for Synchronization
G.Anuradha Reference: William Stallings
Semester Review Chris Gill CSE 422S - Operating Systems Organization
COP 4600 Operating Systems Fall 2010
Inter-Process Communication and Synchronization
MODERN OPERATING SYSTEMS Third Edition ANDREW S
CS140 – Operating Systems Midterm Review
Synchronization Issues
Operating systems Deadlocks.
Lecture 2 Part 2 Process Synchronization
Concurrency: Mutual Exclusion and Process Synchronization
February 5, 2004 Adrienne Noble
CSE 451: Operating Systems Autumn 2003 Lecture 7 Synchronization
CSE 451: Operating Systems Autumn 2005 Lecture 7 Synchronization
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization
CS333 Intro to Operating Systems
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
CSE 542: Operating Systems
Sarah Diesburg Operating Systems CS 3430
Presentation transcript:

1 Exam Feedback Dave Eckhardt

1 Exam – overall ● Grade distribution – 24 A's ( ) – 20 B's (80..89) – 12 C''s (70..79) – 4 other ● No obvious need to curve ● Final exam could be harder ● Grade change requests: end of week

1 Exam - overall ● “And then the OS...” – No!

1 Exam – overall ● “And then the OS...” – This is an OS class! – We are under the hood! – The job is to understand the parts of the OS ● What they do ● How they interact ● Why

1 Q1 ● Are keyboard interrupts really necessary? ● Conditions which remain the same – Input may arrive early (input queue) – Processes may arrive early (waiting queue) ● Focus on what is different – Detecting new input – Carrying it to existing input queue/wait queue

1 Q1 ● “Polling” approach – When? – How long? ● “Create a special process” approach – When does it run? – How long? ● Polling for all of every other quantum is not good – How to interact with wait queue?

1 Q1 (summary) ● Observe that CPU quantum can be set to 5 ms ● Observe people don't need echo for 50 ms ● Re-wire scheduler – Scan keyboard hardware for new scan codes – Invoke pseudo-interrupt ● Basically, same code as your keyboard interrupt handler ● Pseudo-interrupt gives keystroke to process – Put near front of scheduler queue

1 Q2 (a) ● The “process exit” question ● Sum of process memory is 256 K ● Memory freed on exit is 50 K – “Not a multiple of 4 K” ● So? We didn't say it's an x86... – Trying to change the problem: ● 50K “is approximately 16K stack + 32K heap”

1 Q2 (a) - summary ● Virtual-freed != physical-freed due to sharing ● Could be copy-on-write ● Could be shared read-only text regions ● Insight: physical memory is used to make virtual – They are not “the same”

1 Q2 (b) ● Process state graph ● Went well overall

1 Q2 (c) ● Explain why you have no hope of accessing memory belonging to your partner's processes. ● Key concept: address space – Everybody gets their own 0..4 GB ● Other options possible – Segmented address space (Multics) ● But you needed to explain ● Common case: every main() in same place – Sparse virutal address space (EROS)

1 Q3: load_linked()/store_conditional() ● Required to consider multi-processor target – test-and-yield() is bad ● unless you carefully explained it ● Common concern: lock/unlock conflict – Real load-linked()/store-conditional() a bit better – Still an issue (see Hennessey & Patterson) ● random back-off ● occasional yield

1 Q4: “Concentration” card game ● “Global mutex” approach – “Solves” concurrency problems by removing concurrency! – Can be devastating ● (not a technique we covered in class) ● Deadlock avoidance/detection approaches – Hard to get right – There is another option

1 Deadlock prevention ● “Pass a law” – So every possible sequence violates one of: ● Mutual exclusion ● Hold & Wait ● Non-preemption ● Wait cycles

1 Common case ● Violate “wait cycles” ● Establish locking order – Total order on mutexes in system – Pre-sort locks according to order – Or, dump & start over ● Good locking order: memory addresses – &card[i][j] ● each lock is unique ● every lock is comparable to every other lock

1 A subtle mistake ● i1 = generate_random(0, 5); ● j1 = generate_random(0, 5); ● i2 = generate_random(i1, 5); ● j2 = generate_random(j1, 5); ● Good news – No wait cycles ● Bad news? – Starvation of certain cards ● (well, serious bias against)

1 Q5: Critical Section Protocol ● “Hyman's algorithm” – Comments on a Problem in Concurrent Programming ● CACM 9:1 (1966) ● (retracted) ● Doesn't provide mutual exclusion ● Doesn't provide bounded waiting

1 Q5: Critical Section Protocol ● You should understand these problems ● You won't implement mutexes often ● Thought patterns matter for concurrent programming