Designing and Implementing Concurrent Programs with State Diagrams

Charles W. Kann · Auerbach Publications eBooks · 2017

Chapter 2 gave an overview of the facilities in Java for implementing concurrency, as well as some of the common problems that are unique to concurrent programs; however, explaining the mechanisms of concurrency is not sufficient for many programmers learning concurrency. Most programmers have been taught to understand programs as procedural entities — programs start at the first line in main and proceed in a stepwise fashion through the program, executing each statement in its logical order. In addition, programmers are taught that a program is totally ordered, that the execution of the program is deterministic in regard to the order in which statements are executed, so that each time the program is run it produces exactly the same results. So, while some programmers might understand that concurrent programs do not behave procedurally, they do not understand how to structure a program effectively to take advantage of concurrency. This became apparent me when I first started teaching concurrent programming in Java, as many students would attempt to write programs that would control the threads using the suspend, stop, and resume methods, rather than allowing the interactions between the threads to solve the problem.

Read the paper · More papers on PaperTik