COS226 - Lecture - Introduction - 2

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

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

View Full Document Right Arrow Icon
COS226: Concurrent Systems Chapter 1: Introduction Part 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
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;
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online