Multithreaded Programs
Often, threads need to share data. For example, suppose you have a thread
that writes data to a file while, at the same time, another thread is
reading data from that same file. When your threads need to share information
you need to synchronize the threads to get the desired results.
Deadlock occurs when two threads are waiting for some condition to
change that is precluded from changing because of all threads that
can change the condition are waiting. This page uses the dining
philosophers to illustrate the problem of deadlock, and discusses
various ways to avoid it.
Java monitors are re-entrant.
[PENDING: This technology is under construction.]