Introduction To Concurrency: Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 - Lecture 3 - 01/22/2008
Introduction To Concurrency: Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 - Lecture 3 - 01/22/2008
Kenneth M. Anderson
University of Colorado, Boulder
CSCI 5828 — Lecture 3 — 01/22/2008
• Some text and images for this lecture come from the lecture materials
provided by the publisher of the Magee/Kramer textbook. As such, some
material is copyright © 2006 John Wiley & Sons, Ltd.
• Jeff Kramer
• Dean of the Faculty of Engineering and Professor of Distributed
Computing at the Department of Computing at Imperial College London
• ACM Fellow
• Editor of IEEE’s Transactions on Software Engineering
• Winner of numerous software engineering awards including best paper
and outstanding research awards
• Jeff Magee
• Professor at the Department of Computing at Imperial College London
• Long time member of the SE community with more than 70 journal and
conference publications!
• This book’s material is based on their SE research into modeling concurrency
over the past 20 years
• If a machine has more than a single processor, then true parallelism can
occur: you can have N processes running simultaneously on a machine
with N processors
8 1 6
4 7
9
3
2 5
8 1 6 3
4 7 2
9
3 4 1
2 5
5
Communication
Network
• AJAX
• Example: Therac-25
• Mars Rover
• Requirements
• Controlled by three buttons
• on, off, resume
• When ignition is switched on and
on button pressed, current speed
is recorded and system
maintains the speed of the car
at the recorded setting
• Pressing the brake, the
Two Threads: Engine and Control accelerator, or the off button
disables the system
Once implemented:
• Pressing resume re-enables the
Is the system safe?
system
Would testing reveal all errors?
How many paths through system?
Sunday, January 27, 2008 13
Models to the Rescue!
• Note: LTSA requires a Java 2 run time system, version 1.5.0 or later
• On Windows and Mac OS systems, you can run the LTSA tool by double
clicking on its jar file
• Note: Its not the most intuitive piece of software, but once you “grok it”, it
provides all of the advertised functionality
• This can save a lot of time and money, as it is typically easier to test and
evolve a model's behavior than it is to implement the system in a
programming language
• Java is
• Java is used for all examples, demo programs, and homework exercises in
textbook
• This is not to say that Java is the ONLY language that supports
concurrency; many languages have concurrency feature built-in or
available via third-party libraries
• The book makes use of “toy programs” as they can focus quickly on a
particular class of concurrent behavior
• Concepts
• Models
• Practice