Monitors are appealing constructs for synchronization, because they
promote reusable code and present a simple model to the
programmer. For these reasons, several programming languages, such as
Java and Modula-3, directly support them. However, monitors can incur
significant run-time overhead: reusable code modules such as classes
in the Java standard library often contain monitor-based
synchronization for the most general case of concurrent access, even
though particular programs them in a context that is already protected
from concurrency. For instance, a synchronized data structure
may be accessed by only one thread at run time, or access to a
synchronized data structure may be protected by another monitor in the
program. In both cases, unnecessary synchronization increases
execution overhead. Even single-threaded Java programs typically spend
10-60% of their execution time on synchronization
operations. Synchronization overhead can be reduced by manually
restructuring programs but any performance improvement gained
typically comes at the cost of simplicity, maintainability,
reusability, and even program correctness.

The goal of our group is first to characterize the synchronization behavior
of Java benchmarks, and then to develop compiler analyses for
automatically detecting and eliminating sources of unnecessary
synchronization operations. To date, we have developed a comprehensive
suite of analyses for eliminating thread-local, enclosed and reentrant
locks. These analyses eliminate 35-100% of all synchronization in
typical single and multithreaded benchmarks without any programmer
annotations. They are described in more detail in our papers.