Chapter 6. Synchronization

  • Synchronization Issues

  • Synchronization Variables

  • APIs Used in This Chapter

  • The Class java.lang.Object

  • The Class Extensions.Semaphore

  • The Class Extensions.Mutex

  • The Class Extensions.ConditionVar

In which the reader is led on a hunt for the intimidating synchronization variable and discovers that it is not actually as frightening as had been thought. Programs illustrating the basic use of the POSIX and Java primitives are shown.

Synchronization Issues

To write any kind of concurrent program, you must be able to synchronize the different threads reliably. Failure to do so will result in all sorts of ugly, messy bugs. Without synchronization, two threads will start to change some data at the same time; one will overwrite the other. ...

Get Multithreaded Programming with JAVA™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.