State Models and Java Programs

second edition

** Revised by Daniel Sykes, 2013

Example programs:

Chapter 1 - Introduction

Cruise Control

Chapter 2 - Processes & Threads

CountDown Timer

Chapter 3 - Concurrent Execution

Thread Demonstration

Chapter 4 - Shared Objects & Interference

Ornamental garden

Chapter 5 - Monitors & Condition Synchronization


Semaphore Demonstration

Bounded Buffer

Nested Monitor example

Fixed Nested Monitor example

Chapter 6 - Deadlock

Dining Philosophers

Fixed Dining Philosophers

Chapter 7 - Safety & Liveness

Single Lane Bridge

Readers and Writers

Readers and Writers: Writers priority

Readers and Writers: Fair

Chapter 8 - Model-Based Design

Cruise Control - correct version

Chapter 9 - Dynamic Systems

Golf Club

Golf Club: Fair Allocator

Golf Club: Bounded Overtaking Allocator

Master/ Slave using join()

Chapter 10 - Message Passing

Synchronous Message Passing

Selective Receive Message Demo

Asynchronous Message Passing

Rendezvous Message Passing Demo

Chapter 11 - Concurrent Architecture

Primes Sieve

Supervisor Worker


Chapter 12 - Timed Systems

Parcel Sorter

Space Invaders

Applets require Java™ 2 Platform Standard Edition (version 1.5.0 or later)