Lec13 - Summary of previous 12 lectures Concurrency As a...

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

View Full Document Right Arrow Icon
1 Revision -Last lecture Abhik Roychoudhury CS 3211 National University of Singapore CS3211 2009-10 by Abhik Roychoudhury 1 Summary of previous 12 lectures ` Concurrency ` As a concept. ` Concurrent program execution – inter-leavings ` Critical section and ensuring mutual exclusion ` Semaphores, Monitors ` Deadlocks, Starvation and preventing them. ` Concurrent programming ` All of the above concepts as evidenced in multi-threaded Java ` Parallel programming ` Message passing model studied via MPI CS3211 2009-10 by Abhik Roychoudhury 2 In today’s discussion ` Revision ` Promela – concurrency concepts ` Java – concurrent programming ` MPI – parallel programming CS3211 2009-10 by Abhik Roychoudhury 3 Comment on the following protocol bool wantP = false, wantQ = false; active proctype P() { do :: printf(“noncritical section\n”); wantP = true; active proctype Q() { do :: printf(“noncritical section\n”); wantQ = true; do CS3211 2009-10 by Abhik Roychoudhury 4 do :: !wantQ -> break; :: else -> skip od; printf(“Crit. Section P\n”); wantP = false od } :: !wantP -> break; :: else -> skip od; printf(“Crit. Section Q\n”); wantQ = false od } … and, the following one? bool wantP = false, wantQ = false; active proctype P() { do :: printf(“noncritical section\n”); atomic{ !wantQ; wantP = true; } active proctype Q() { do :: printf(“noncritical section\n”); atomic{ !wantP; wantQ = true; } CS3211 2009-10 by Abhik Roychoudhury 5 printf(“critical section\n”); wantP = false od }
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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

Lec13 - Summary of previous 12 lectures Concurrency As a...

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

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