# CS3211-Tut7 - CS3211 Parallel and Concurrent Programming...

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

CS3211 Parallel and Concurrent Programming – Guidelines for tutorial (15-19 March 2010) Sample Exercises: [Please conduct these as an interactive discussion, rather than an evaluation. Please also make it clear to the students that they are not being evaluated for their performance in these exercises, so that they are not afraid to make mistakes while answering.] 1. Following a maze which we discussed towards the end of last week’s lecture (March 11). Write a process equation, such that using deadlock analysis (path to a state with no outgoing action) we can find the shortest path out of the maze. 012 345 6 78 STOP north south west east Answer: MAZE(Start) = P[Start], P[0] = (north->STOP|east->P[1]), P[1] = (east ->P[2]|south->P[4]|west->P[0]), P[2] = (south->P[5]|west ->P[1]), P[3] = (east ->P[4]|south->P[6]), P[4] = (north->P[1]|west ->P[3]), P[5] = (north->P[2]|south->P[8]), P[6] = (north->P[3]), P[7] = (east ->P[8]), P[8] = (north->P[5]|west->P[7]). GETOUT = MAZE(7).

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

View Full Document
2. It is possible for the following system to deadlock. Explain how this deadlock occurs.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/02/2011 for the course CS 3211 taught by Professor Dunnowho during the Spring '11 term at National University of Singapore.

### Page1 / 3

CS3211-Tut7 - CS3211 Parallel and Concurrent Programming...

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

View Full Document
Ask a homework question - tutors are online