comp30112 concurrency
play

COMP30112: Concurrency Introduction to Course & Introduction to - PowerPoint PPT Presentation

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


  1. 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

  2. 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.

  3. 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.

  4. 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.

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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

  10. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Assessment 2 hour examination

  11. 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

  12. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I What is Concurrency? A set of sequential programs executed in abstract parallelism

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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)

  18. 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)

  19. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard?

  20. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development

  21. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance

  22. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Why is concurrency hard? • algorithm development • efficiency and performance • simulation and testing: NON DETERMINISM

  23. 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.

  24. 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)

  25. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency

  26. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world?

  27. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Modelling Concurrency • a ‘simplified’ representation of the real world? • modelling before implementing

  28. 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

  29. 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 )

  30. 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

  31. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I Example: Cruise Control System • Does it do what we expect? Is it safe?

  32. Topic 1: Introduction Topic 2: Modelling Processes with FSP - I FSP: Animation INPUTSPEED = ( engineOn -> CHECKSPEED ), CHECKSPEED = ( speed -> CHECKSPEED | engineOff -> INPUTSPEED ).

  33. 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}

  34. 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

  35. 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

  36. 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