Topic 1: Introduction Topic 2: Modelling Processes with FSP - I COMP30112: Concurrency Introduction to Course & Introduction to FSP Howard Barringer Room KB2.20: email: Howard.Barringer@manchester.ac.uk January 2008
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Acknowledgement This course was initially prepared by Dr Alan Williams and then subsequently updated by myself during sessions 2004/05 and 2005/2006.
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Acknowledgement This course was initially prepared by Dr Alan Williams and then subsequently updated by myself during sessions 2004/05 and 2005/2006. The material is firmly based on that of: Profs Magee and Kramer of Imperial College, Dept of Computing, London.
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Acknowledgement This course was initially prepared by Dr Alan Williams and then subsequently updated by myself during sessions 2004/05 and 2005/2006. The material is firmly based on that of: Profs Magee and Kramer of Imperial College, Dept of Computing, London. Many thanks to all concerned.
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Contents Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Outline Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Course Structure and Topics Lectures Topic 1 Introduction and Overview 5 FSP: Modelling Processes 5 Properties: Safety, liveness 2 Process Equality 2 Java Threads 6 Concurrency Patterns: Mutual Exclusion Monitors+Semaphores Producers/Consumers Readers/Writers GUIs Termination 1 Revision
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I General Comments • Some concepts familiar from COMP20051 and COMP20081 • We follow much of Magee and Kramer, but more on modelling • Java ≃ COMP20051 • Java used to illustrate — BUT this is NOT a programming course
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Supporting and Background Material Books Jeff Magee and Jeff Kramer. Concurrency: State Models and Java Programs. 2nd Edition, Wiley, 2006. L. Aceto, A Ing´ olfsd´ ottir, K. Larsen and J Srba. Reactive Systems: Modelling, Specification and Verification. Cambridge University Press, 2007. R. Milner. Communication and Concurrency. Prentice-Hall, 1989. C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall, 1985. LTSA: Magee and Kramer’s modelling and analysis tool (associated with book) Exercises: offline and in lectures Lecture Slides: hardcopy and PDF Notes on FSP
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Assessment 2 hour examination
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Outline Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism • thread [of control] • multi-threading • light-weight threads
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism • thread [of control] • multi-threading • light-weight threads • parallel processing
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism • thread [of control] • multi-threading • light-weight threads • parallel processing • multi-processing • multi-tasking
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism • thread [of control] • shared memory • multi-threading • protected work-space • light-weight threads • parallel processing • multi-processing • multi-tasking
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism • thread [of control] • shared memory • multi-threading • protected work-space • light-weight threads • parallel processing • message-passing • multi-processing (synchronous or • multi-tasking asynchronous)
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why use Concurrency? • often more closely fits intuition • performance issues • increased responsiveness and throughput (esp. GUIs)
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard?
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance • simulation and testing: NON DETERMINISM
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance • simulation and testing: NON DETERMINISM • analysis of properties: deadlock, livelock, fairness, liveness, etc.
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance • simulation and testing: NON DETERMINISM • analysis of properties: deadlock, livelock, fairness, liveness, etc. We will consider: Modelling, Analysis and Implementation (in Java)
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world?
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world? • modelling before implementing
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world? • modelling before implementing • model captures interesting aspects: concurrency • animation • analysis
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world? • modelling before implementing • model captures interesting aspects: concurrency • animation • analysis • Model Description Language: FSP ( Finite State Processes ) • Models: LTS ( Labelled Transition Systems )
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Outline Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Example: Cruise Control System • Does it do what we expect? Is it safe?
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I FSP: Animation INPUTSPEED = ( engineOn -> CHECKSPEED ), CHECKSPEED = ( speed -> CHECKSPEED | engineOff -> INPUTSPEED ).
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Structure Diagrams CONTROL CRUISE SENSOR CONTROLLER SCAN Sensors Engine Prompts INPUT SPEED speed setThrottle THROTTLE SPEED CONTROL set Sensors = {engineOn,engineOff,on,off, resume, brake, accelerator} set Engine = {engineOn,engineOff} set Prompts = {clearSpeed,recordSpeed, enableControl,disableControl}
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Outline Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Implementation in Java • Thread class; Runnable interface • starting, stopping, suspending threads • mutual exclusion: synchronized methods and code blocks • monitors, condition synchronization • wait , notify , notifyAll • sleep , interrupt • suspend , resume , stop • properties: safety, liveness
Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Outline Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary
Recommend
More recommend