COS226 - Lecture - Introduction - 2

# COS226 - Lecture - Introduction - 2 - COS226 Concurrent...

This preview shows pages 1–5. Sign up to view the full content.

COS226: Concurrent Systems Chapter 1: Introduction Part 2

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

View Full Document
Producer-Consumer Alice 1. Alice waits until the can is down 2. She releases the pets 3. When the pets return, Alice checks the food. If it is finished, she places the can upright Bob 1. Bob waits until the can is up 2. He then puts food in the yard 3. He returns to his house, pulls the string and knocks the can down.
Producer-Consumer Analysis: Mutual exclusion The can is a state machine with two states: up and down; We argue that mutual exclusion holds since it holds initially and continues to hold when transitioning from any state to any other;

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

View Full Document
Initially, the can is either up or down: let's say down; Then the pets can go in and mutual exclusion holds; Before Alice can raise the can, the pets must leave – mutual exclusion is maintained because the pets won't return until the can is knocked over again; In order for the can to be knocked over, Bob must leave the yard and will not enter again until the can is
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/11/2010 for the course COS COS226 taught by Professor Klazar during the Spring '10 term at University of Pretoria.

### Page1 / 11

COS226 - Lecture - Introduction - 2 - COS226 Concurrent...

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

View Full Document
Ask a homework question - tutors are online