(a) Alice and Bob are back together. Today Alice wants to send Bob a message that is secret and also authenticated, so that Bob "knows" the message came.

Slides:



Advertisements
Similar presentations
Operating Systems Semaphores II
Advertisements

Operating Systems ECE344 Midterm review Ding Yuan
(a) Alice and Bob are back together. Today Alice wants to send Bob a message that is secret and also authenticated, so that Bob "knows" the message came.
Practice Session 7 Synchronization Liveness Deadlock Starvation Livelock Guarded Methods Model Thread Timing Busy Wait Sleep and Check Wait and Notify.
1 Deadlock Solutions: Avoidance, Detection, and Recovery CS 241 March 30, 2012 University of Illinois.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
 Read about Therac-25 at  [  [
COS Operating System Assignment 4 (Precept 2) Inter-Process Communication and Process management Fall 2004.
Ch 7 B.
Section 3. True/False Changing the order of semaphores’ operations in a program does not matter. False.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Chapter 6: Process Synchronization
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
1 CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
The "missed wakeup problem” occurs when a thread calls an internal sleep() primitive to block, and another thread calls wakeup() to awaken the sleeping.
Chapter 3 The Critical Section Problem
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
Threading Part 4 CS221 – 4/27/09. The Final Date: 5/7 Time: 6pm Duration: 1hr 50mins Location: EPS 103 Bring: 1 sheet of paper, filled both sides with.
Today From threads to file systems
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Deadlock Prevention CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Chapter 2.3 : Interprocess Communication
Building Secure Software Chapter 9 Race Conditions.
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.
CY2003 Computer Systems Lecture 11 Review Lecture.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
What is the output generated by this program? Please assume that each executed print statement completes, e.g., assume that each print is followed by an.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Semaphores. Readings r Silbershatz: Chapter 6 Mutual Exclusion in Critical Sections.
What is the output generated by this program? (Assume that there are no errors or failures.) [30 pts] CPS 310 final exam, 12/12/2014 Your name please:
Consider the short (and useless) C program off to the right. Each of the variables {a, b, c} references an integer value that occupies some memory at runtime.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
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.
(a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not always the same. So please give three examples.
CSC321 Concurrent Programming: §5 Monitors 1 Section 5 Monitors.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 7: Process Synchronization Background The Critical-Section Problem Synchronization.
11/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
Consider the program fragment below left. Assume that the program containing this fragment executes t1() and t2() on separate threads running on separate.
(a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not necessarily the same in each execution. What.
SPL/2010 Guarded Methods and Waiting 1. SPL/2010 Reminder! ● Concurrency problem: asynchronous modifications to object states lead to failure of thread.
Monitors and Blocking Synchronization Dalia Cohn Alperovich Based on “The Art of Multiprocessor Programming” by Herlihy & Shavit, chapter 8.
1 Condition Variables CS 241 Prof. Brighten Godfrey March 16, 2012 University of Illinois.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
6.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Module 6: Process Synchronization.
CSC Multiprocessor Programming, Spring, 2012 Chapter 10 – Avoiding Liveness Hazards Dr. Dale E. Parson, week 11.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
CSE 451 Section 4. 2 Synchronization High-level Monitors Java synchronized method OS-level support Special variables – mutex, semaphor, condition var.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
CS162 Section 2. True/False A thread needs to own a semaphore, meaning the thread has called semaphore.P(), before it can call semaphore.V() False: Any.
/50 /60 /40 /30 A Tale of Two Clients
CPS 310 midterm exam #1, 2/19/2016 Your name please: ___________________ NetID:___________ /40 /40 /50.
Process Synchronization: Semaphores
Background on the need for Synchronization
CPS 512 midterm exam #1, 10/5/17 Your name please: NetID:_______ Sign for your honor:____________________________.
Chapter 6 Synchronization Principles
February 5, 2004 Adrienne Noble
CSE 451 Section 1/27/2000.
CSE 153 Design of Operating Systems Winter 2019
“The Little Book on Semaphores” Allen B. Downey
Software Engineering and Architecture
Synchronization and liveness
Presentation transcript:

(a) Alice and Bob are back together. Today Alice wants to send Bob a message that is secret and also authenticated, so that Bob "knows" the message came from Alice. Alice and Bob have keypairs and each knows the other's public key. How should Alice send the message? How should Bob validate the message? Briefly explain why your scheme works, and note any additional assumptions. CPS 210 second midterm exam, 4/5/2013 Your name please: Part 1. Cryptosystems (b) One-way hash functions are fast and cheap. But what are they good for? I am looking for two specific examples of how they are used in practice, explaining how their properties are useful for those examples. (c) What are the defining properties of a session key? Why is it useful to establish a session key? Show how to use asymmetric crypto to establish a session key.

CPS 210 second midterm exam, 4/5/2013, page 2 of 7 Part 2. Synchronization both ways This part asks you to write code to synchronize a standard event/request queue, as discussed in class. As always: “Any kind of pseudocode is fine as long as its meaning is clear. You may assume standard data structures, e.g., linked lists: don’t write code for those.” Threads place event records on the queue using the put method. (E.g., put might be called by a network connection handler.) A pool of worker threads get event records from the queue and process/handle those events. When a handler completes, the worker calls get again for the next event. The workers sleep if the queue is empty. Note: I am only asking you to code up the put and get methods, and not any thread/code that calls those methods. (a) Implement put and get using monitors (mutex + condition variable). event queue worker loop Worker thread do: { get next event; invoke handler; loop.} (Sleep if no events.) put handler get put (Event e) { get() returns Event e { }}

(b) Implement put and get using semaphores. CPS 210 second midterm exam, 4/5/2013, page 3 of 7 (c) Is this system vulnerable to deadlock? Why or why not? put (Event e) { get() returns Event e { }}

Part 3. Condition variables The following is a list of statements about condition variables. For each statement, discuss a specific example to show that is true (at least sometimes) or false (at least sometimes), or both. (a)Code that waits on a condition variable must “loop before leaping”: check a condition after returning from wait, and wait in a loop until the condition is satisfied. (a)Calls to wait on a condition variable may appear only in a locked critical section. It is given that Java (for example) throws an exception if this requirement is not met. I want you to explain why condition variables have this requirement, i.e., give an example of what could go wrong without it. Can condition variables ever be used safely without holding a lock? (a)“Condition variable signal/notify is just a performance hint”: it is generally safe to use broadcast/notifyAll instead of signal/notify, but it may be slower. CPS 210 second midterm exam, 4/5/2013, page 4 of 7

Part 4. File systems and storage Please answer the following questions crisply without writing a book. Key words will do. Feel free to draw pictures! (a)What factors influence access time for storage media? How? (a)[Optional extra credit] How does adaptive internal priority help to improve disk bandwidth utilization? (a)What is the purpose of indirect blocks? Why do some files have them and others do not? CPS 210 second midterm exam, 4/5/2013, page 5 of 7

Part 4. File systems and storage (continued) (d) How does the classical Unix file system structure use reference counts? (f) What is an inode file? What purpose does it serve? (e) Raw disk bandwidth (“spindle speed”) continues to improve exponentially, while seek latencies are not improving much at all. What is the impact of this trend on effective bandwidth? Sketch a graph, assuming a constant stream of requests with some fixed block size. CPS 210 second midterm exam, 4/5/2013, page 6 of 7 spindle speed effective bandwidth 1

Part 5. Scheduling for response time This question asks you to modify your answer for Part 2 (event queue put and get) to reduce average response time. Suppose there are three types of incoming events with different average service demands: the handler for type A events takes one time unit to complete, type B events take 2 units, and type C events take 3 units. You may assume each event record is tagged with exactly one type code (A, B, or C). Your solution should be free from starvation. CPS 210 second midterm exam, 4/5/2013, page 7 of 7