lect25 - CMSC 216 Introduction to Computer Systems Lecture...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 216 Introduction to Computer Systems Lecture 25 Synchronization II Jan Plane & Pete Keleher {jplane, [email protected] 2 Definition of terms Race Condition – Where the order of execution of instructions influences the result produced – Important cases for race detection are shared objects • counters: in the last example Mutual exclusion – only one process at a time can be updating shared objects Critical section – region of code that updates or uses shared data • to provide a consistent view of objects need to make sure an update is not in progress when reading the data – need to provide mutual exclusion for a critical section
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3 Critical Section Problem processes must – request permission to enter the region – notify when leaving the region protocol needs to 1)provide mutual exclusion • only one process at a time in the critical section 2)ensure progress • no process outside a critical section may block another process 3)guarantee bounded waiting time • limited number of times other processes can enter the critical section while another process is waiting not depend on number or speed of CPUs • or other hardware resources 4 Critical Section (cont) May assume that some instructions are atomic typically load, store, and test word instructions Algorithm #1 for two processes
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2012 for the course CMSC 216 taught by Professor Plane during the Spring '11 term at Maryland.

Page1 / 7

lect25 - CMSC 216 Introduction to Computer Systems Lecture...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online