Concurrency State Models and Java Programs

Jeff Magee and Jeff Kramer John Wiley and Sons, New York, NY, 1999, 374 pp. ISBN 0471987107, $64.99 The book is an introductory text to the ideas, concepts, and topics of concurrency. The text focuses on understanding concepts and techniques, and problems of concurrency, not on the implementation or language. The author's overall goal is that by a combination of learning and doing using Java should make the process of acquiring the skills relating to concurrency interesting, enjoyable, and challenging. The Java language is thus used only for illustration and programming experience of the reader. The book is intended for a computer science student or software developer. A background in programming is expected, as well as some familiarity with the essential concepts of object-oriented programming. Knowledge of the Java programming language and operating systems concepts is beneficial but not required. After reading the text, a reader can expect to have a broad understanding of the concepts of concurrency, the problems that arise, methods to emphasis desirable properties in a concurrent system, and ways to avoid the undesirable ones. The text provides a systematic treatment of concepts, as means to rigorously specify and model concurrent systems, with Java examples to animate and illustrate the concepts discussed. The book is organized into twelve chapters, with three appendices. The first eight chapters provide a concise and comprehensive foundation of concurrency, with the remaining four chapters focusing on more advanced concepts. The latter four chapters are somewhat supplemental and can be read at the discretion of the reader. The content of the text is self-contained, with no reliance upon external references. The authors provide a concluding set of notes and further topics which reference external works, but these are not used in the chapter contents. The introduction provides the foundation for the book, and an idea of what will follow in the rest of the text. The basics of modeling and Java are covered. Authors follow with the concepts of processes, threads and with the idea of concurrency. The emphasis is on using Java, and on the notation used to define a concurrent process or thread. The discussion continues covering interleaving and asynchronous concurrency. Various details about composition of parallel processes and finite state processing modeling are presented. The programming of concurrent execution using Java is then examined via the concept of multiple threads. Here, sharing objects among Java threads is also discussed. The concept of conditional synchronization is covered next, and is used to construct a monitor. The methods of the base object in Java is used, and a waiting queue associated with a Java object is discussed and implemented. This discussion is followed by introduction of deadlock. Authors show the conditions necessary for a deadlock to occur and present an analysis of a concurrent system establishing that such a system is deadlock-free. The classic Dining Philosopher's problem is used to illustrate the distinction between finding deadlocks in models and in programs. The presentation continues with the safety property (that asserts that nothing bad happens), and the liveliness property (that asserts that nothing good happens). Here, authors use the material on model-based design to consolidate many of the concepts previously discussed. No one modeling method or design methodology is emphasized. Then creation and elimination of threads in a running program is covered next. The dynamic starting and stopping of Java threads is presented. The discussion moves then to messaging passing. Asynchronous and synchronous messaging is presented with Java programming examples. The concept of a rendezvous, allowing for interaction in a messaging system, is also presented. Based on the concepts developed so far filter-pipeline, supervisor-worker, and announcer-listener concurrent architectures are examined. Java programs demonstrating how the elements of each model interact at runtime are developed. The presentation completes with modeling and implementing of timed systems. Time is signaled by the passage of successive time ticks. The authors then elaborate on a system that is event-based rather than thread-based. Java programs are used to illustrate in implementation the concepts discussed. The three appendices provide a reference, specification, and listing of semantics for the finite-state modeling algebra used by the authors throughout the book. The text is ideal for teaching in a classroom environment, or for a motivated reader to use for self-paced learning. Its organization follows a logical train of discussion and thought, with each chapter building successively on the other, with the more difficult concepts and topics withheld until later. This gradual approach makes the material flow smoothly and cohesively from the beginning to the end. The book is intended as a textbook, so does organize the material and discussion as one, but does not become too dry or bland to stifle the reader's interest in the material. The examples are inter-mixed with the discussion to highlight and emphasize essential points the authors make in each chapter. The text illustrates concepts well under discussion, and does not become a long-winded recital of theory. The topics examined are fundamental to concurrency, and are well illustrated and discussed, but no one topic is examined extensively. The code examples are well written concerning the programming style, indentation and comments. A CD is provided, containing the codes from the book. In addition supplementary material consisting of presentation slides and an errata is provided on the author's WWW site, as well as on the CD. The book is up to date both on the topics of concurrency, and with the Java applets, code, and programs used to illustrate them. Later, as the Java language evolves, the examples may need to be updated, but for the time being the text well represents that state of the Java language. William F. Gilreath, Micron Technology, Inc., Boise Idaho