cs205: engineering software

Slides:



Advertisements
Similar presentations
Database Systems Lecture 16 Natasha Alechina
Advertisements

1 Deadlock Solutions: Avoidance, Detection, and Recovery CS 241 March 30, 2012 University of Illinois.
Relaxed Consistency Models. Outline Lazy Release Consistency TreadMarks DSM system.
Race Directed Random Testing of Concurrent Programs KOUSHIK SEN - UNIVERSITY OF CALIFORNIA, BERKELEY PRESENTED BY – ARTHUR KIYANOVSKI – TECHNION, ISRAEL.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 13: Concurring Concurrently.
1/25 Concurrency and asynchronous computing How do we deal with evaluation when we have a bunch of processors involved?
Review: Process Management Objective: –Enable fair multi-user, multiprocess computing on limited physical resources –Security and efficiency Process: running.
Review: Process Communication Sequential Communication –Result of P1 becomes at termination the input to P2 –Tools: Redirect (>,>>) and Pipe (|) Concurrent.
CS444/CS544 Operating Systems Synchronization 2/21/2007 Prof. Searleman
Transactions and Recovery
Concurrency Recitation – 2/24 Nisarg Raval Slides by Prof. Landon Cox.
1 Advanced Computer Programming Concurrency Multithreaded Programs Copyright © Texas Education Agency, 2013.
CSE 380 – Computer Game Programming Render Threading Portal, by Valve,
Games Development 2 Concurrent Programming CO3301 Week 9.
Parallel Processing Sharing the load. Inside a Processor Chip in Package Circuits Primarily Crystalline Silicon 1 mm – 25 mm on a side 100 million to.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
Kernel Locking Techniques by Robert Love presented by Scott Price.
The Relational Model1 Transaction Processing Units of Work.
CS162 Week 5 Kyle Dewey. Overview Announcements Reactive Imperative Programming Parallelism Software transactional memory.
Deadlocks. What is a Deadlock “A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set.
Debugging Threaded Applications By Andrew Binstock CMPS Parallel.
Threads and Singleton. Threads  The JVM allows multiple “threads of execution”  Essentially separate programs running concurrently in one memory space.
Instructor: Craig Duckett Lecture 07: Tuesday, October 20 th, 2015 Conflicts and Isolation, MySQL Workbench 1 BIT275: Database Design (Fall 2015)
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
David Evans CS150: Computer Science University of Virginia Computer Science Class 37: How to Find Aliens (and Factors)
Concurrent Programming Acknowledgements: Some slides adapted from David Evans, U. Virginia.
Linux Kernel Development Chapter 8. Kernel Synchronization Introduction Geum-Seo Koo Fri. Operating System Lab.
Mergesort example: Merge as we return from recursive calls Merge Divide 1 element 829.
Concurrency 2 CS 2110 – Spring 2016.
Aberdeen Area Human Resource Association Presents Active Shooter Training – ALICE Model Presented by: Sergeant Keith Theroux, Aberdeen Police Department.
COMPSCI210 Recitation 12 Oct 2012 Vamsi Thummala
Multiple Writers and Races
Lab #3, CS 112 Please sign your name at the back Quiz 2 (15 minutes)
CS703 - Advanced Operating Systems
Locking cs205: engineering software
Parallel Architectures
Lecture 5: GPU Compute Architecture
GREETINGS.
Introduction to Concurrency
Lecture 15: Concurring Concurrently CS201j: Engineering Software
Concurring Concurrently
Lecture 5: GPU Compute Architecture for the last time
Informatics 43 – April 14, 2016.
Bombs & Hearts.
Concurrency and Threads
Databases & Consistency
DEV422 Becoming a C# Time Lord Joe Albahari 2/5/ :46 AM
Lecture 21: Intro to Transactions & Logging III
Software Transactional Memory Should Not be Obstruction-Free
Assignment 6 Recitation
CSE 451: Operating Systems Spring 2005 Module 8 Deadlock
Pastoral Care.
Why Threads Are A Bad Idea (for most purposes)
Chris Gill CSE 522S – Advanced Operating Systems
CSCI1600: Embedded and Real Time Software
CSE 451: Operating Systems Winter 2004 Module 8 Deadlock
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CSE 451: Operating Systems Winter 2006 Module 8 Deadlock
CSE 332: Concurrency and Locks
EECE.4810/EECE.5730 Operating Systems
Software Engineering and Architecture
CMSC 202 Threads.
Ch 3.
Asynchronous Programming CS Programming Languages for Web Applications
CS444/544 Operating Systems II Scheduler
Let my light shine and bright
Presentation transcript:

cs205: engineering software university of virginia fall 2006 Kramer Sharp

Partial Ordering of Events Sequential programs give use a total ordering of events: everything happens in a determined order Concurrency gives us a partial ordering of events: we know some things happen before other things, but not total order

Race Condition Bob “When can you meet Friday?” Alice Colleen Doug “When can you meet Friday?” “9, 11am or 3pm” “9am or 11am” “9, 11am or 3pm” Picks meeting time Reserves 11am for Doug “Let’s meet at 11am” “Let’s meet at 11am” “Let’s meet at 11am” “I’m busy then…”

Preventing Race Conditions Use locks to impose ordering constraints After responding to Alice, Bob reserves all the times in his response until he hears back (and then frees the other times)

Locking Bob “When can you meet Friday?” Alice Colleen Doug “When can you meet Friday?” “9, 11am or 3pm” “9am or 11am” Picks meeting time Locks calendar “Let’s meet at 11am” “3pm” “Let’s meet at 11am” “Let’s meet at 3”

Deadlocks “When can you meet Friday?” Doug Bob Alice Colleen Locks calendar for Doug, can’t respond to Alice “When can you meet Friday?” “When can you meet Friday?” “When can you meet Friday?” “9, 11am or 3pm” Can’t schedule meeting, no response from Bob Locks calendar for Alice, can’t respond to Doug Can’t schedule meeting, no response from Colleen

Why are threads hard? Too few ordering constraints: race conditions Too many ordering constraints: deadlocks Hard/impossible to reason modularly If an object is accessible to multiple threads, need to think about what any of those threads could do at any time! Testing is even more impossible than it is for sequential code Even if you test all the inputs, don’t know it will work if threads run in different order