Four Kinds of Threads Programming

Coordination between different threads is known as synchronization. Programs that use threads can be divided into the following four levels of difficulty, depending on the kind of synchronization needed between the different threads.

  1. Unrelated threads

  2. Related but unsynchronized threads

  3. Mutually exclusive threads

  4. Communicating mutually exclusive threads

We will deal with the first two here and the second two in the next chapter. Figure 13-3 is the key for all illustrations dealing with this topic.

Figure 13-3. Key to threads diagrams

image

Unrelated threads

The simplest threads program involves threads ...

Get Just Java™ 2 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.