This chapter covers threads and synchronization in Java and in the Java Virtual Machine. Threads are the de facto mechanism for running several parallel tasks in a process. Locks are the de facto mechanism for constraining access to a critical section of code to one thread at a time. These are the building blocks we need in order to implement parallelism in software.
You will learn the following from this chapter:
wait, notify, and the often misunderstood
volatilekeyword. We will also briefly look at the