CS533 - Concepts of Operating Systems 1 Class Discussion.

Slides:



Advertisements
Similar presentations
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
Advertisements

CS 603 Process Synchronization: The Colored Ticket Algorithm February 13, 2002.
CH7 discussion-review Mahmoud Alhabbash. Q1 What is a Race Condition? How could we prevent that? – Race condition is the situation where several processes.
Scalable Reader-Writer Synchronization for Shared- Memory Multiprocessors Mellor-Crummey and Scott Presented by Robert T. Bauer.
© 2004, D. J. Foreman 1 Basic Synchronization Semaphores.
Synchronization without Contention John M. Mellor-Crummey and Michael L. Scott+ ECE 259 / CPS 221 Advanced Computer Architecture II Presenter : Tae Jun.
Synchronization. Shared Memory Thread Synchronization Threads cooperate in multithreaded environments – User threads and kernel threads – Share resources.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
Concurrency: Mutual Exclusion and Synchronization Why we need Mutual Exclusion? Classical examples: Bank Transactions:Read Account (A); Compute A = A +
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
CS533 Concepts of Operating Systems Class 3 Monitors.
CS533 - Concepts of Operating Systems 1 CS533 Concepts of Operating Systems Class 8 Synchronization on Multiprocessors.
CS533 - Concepts of Operating Systems 1 Class Discussion.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
CS533 - Concepts of Operating Systems 1 Class Discussion.
1 Lecture 22: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Synchronization CSCI 444/544 Operating Systems Fall 2008.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
A Behavioral Memory Model for the UPC Language Kathy Yelick Joint work with: Dan Bonachea, Jason Duell, Chuck Wallace.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Chapter 6 Process Synchronization Copyright © 2008.
CS510 Concurrent Systems Jonathan Walpole. A Lock-Free Multiprocessor OS Kernel.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Caltech CS184 Spring DeHon 1 CS184b: Computer Architecture (Abstractions and Optimizations) Day 12: May 3, 2003 Shared Memory.
Maged M.Michael Michael L.Scott Department of Computer Science Univeristy of Rochester Presented by: Jun Miao.
© 2004, D. J. Foreman 1 Basic Synchronization Semaphores.
CS 3204 Operating Systems Godmar Back Lecture 7. 12/12/2015CS 3204 Fall Announcements Project 1 due on Sep 29, 11:59pm Reading: –Read carefully.
Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects Maged M. Michael Presented by Abdulai Sei.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
Threaded Programming Lecture 1: Concepts. 2 Overview Shared memory systems Basic Concepts in Threaded Programming.
1 Previous Lecture Overview  semaphores provide the first high-level synchronization abstraction that is possible to implement efficiently in OS. This.
CSE 153 Design of Operating Systems Winter 2015 Lecture 5: Synchronization.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University.
CS4315A. Berrached:CMS:UHD1 Process Synchronization Chapter 8.
1 Processes and Threads Part II Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
CS 153 Design of Operating Systems Winter 2016 Lecture 7: Synchronization.
Correctness of parallel programs Shaz Qadeer Research in Software Engineering CSEP 506 Spring 2011.
Queue Locks and Local Spinning Some Slides based on: The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Homework-6 Questions : 2,10,15,22.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Multiprocessors – Locks
CSE 120 Principles of Operating
Multi-processor Scheduling
CS533 Concepts of Operating Systems Class 3
Atomicity CS 2110 – Fall 2017.
Semester Review Chris Gill CSE 422S - Operating Systems Organization
COP 4600 Operating Systems Fall 2010
COMS Prelim 1 Review Session
Thread Implementation Issues
COT 5611 Operating Systems Design Principles Spring 2012
Software Transactional Memory Should Not be Obstruction-Free
CS533 Concepts of Operating Systems Class 3
CSE 451: Operating Systems Winter 2007 Module 6 Synchronization
Kernel Synchronization II
Basic Synchronization
CSE 451: Operating Systems Autumn 2004 Module 6 Synchronization
CSE 451: Operating Systems Autumn 2003 Lecture 7 Synchronization
CSE 451: Operating Systems Autumn 2005 Lecture 7 Synchronization
CSE 451: Operating Systems Winter 2004 Module 6 Synchronization
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization
CSE 153 Design of Operating Systems Winter 19
CS333 Intro to Operating Systems
CSE 451: Operating Systems Winter 2007 Module 6 Synchronization
CSE 451: Operating Systems Autumn 2009 Module 7 Synchronization
CS Introduction to Operating Systems
Presentation transcript:

CS533 - Concepts of Operating Systems 1 Class Discussion

CS533 - Concepts of Operating Systems 2 Questions Naive reader preference lock: o How do readers spin? what instruction is used on what location? why is this expensive? o How do writers spin? what instruction is used on what location? why is this expensive? o Why can't end_write simply clear the lock? o How might writers be starved?

CS533 - Concepts of Operating Systems 3 Questions Naive fair lock: o What is the key idea that enables fairness? o Why is it "naive“ how do readers and writers spin?

CS533 - Concepts of Operating Systems 4 Questions Algorithm 1: o What prevents a race between two potential acquirers in acquire_lock? o What location do threads spin on when contending for a lock? o How is I->locked updated to allow a spinning thread to proceed? Are subsequent accesses local? o Why might a thread have to spin in release_lock? o What stops the lock holder spinning indefinitely in release_lock, o Why does release_lock without CAS sacrifice FIFO ordering?

CS533 - Concepts of Operating Systems 5 Questions Smarter locks: o How is algorithm 1 extended to support readers and writers? o Why do threads need to read/update their predecessor rather than just successor? o Are these algorithms race-free? o Are they correct?

CS533 - Concepts of Operating Systems 6 Questions  What if the required atomic instructions are not available? o What is the problem with implementing them via kernel calls?  How can processors access private memory without using the interconnect/bus?  How realistic is a 3:1 read:write ratio?  How expensive is reading vs writing? o how should you favor performance of one over the other?  How would you expect the performance to change with changing costs of underlying primitives?