The Java Memory Model is a part of the Java Language Specification that
covers, among other topics, the effects of synchronization by means of
locks, the use of volatile and atomic variable, the guarantees given for
final fields. It has been around since the advent of Java and underwent
a major overhaul in release 5.0 of Java. Despite of its existence since
day one of Java it is an area of the language that many developers do not
feel comfortable with. It is considered guru knowledge and best ignored.
Avoidance, however, is no longer practical.
These days the prevalence of multicore processors requires that essentially
all Java applications must be multi-threaded if the want to take advantage
of the available cpu power. Inevitably many applications will make the
transition from a single-core architecture to a multi-core or multi-cpu
platform. This migration occasionally reveals (so far dormant) bugs
in the program: applications that worked properly and reliably in a single-core
context suddenly and inexplicably exhibit errors in a multi-core context.
Often this is due to the substantially more aggressive caching techniques
used on the processor level in combination with misconceptions regarding
the Java Memory Model on the programmer's side. In order to avoid
such misconeptions, the workshop discusses the Java Memory Model comprehensively
and in depth.
A proper understanding of the Java Memory Model does not only help tracking
down and fixing bugs. In addition, it allows development Java programs
with perceivably higher performance.
The elimination or at least reduction of sychronization is becoming
increasingly important in a multi-core and multi-processor world.
Using a multi-cpu platform users expect that an application should scale,
that is, its performance should increase with the number of available cpus.
This highly desirable effect does not occur automatically, but has to be
built into the application. Sequential, i.e., non-parallel, parts
of the program must be drastically reduced in order to utilize the multiple
cpus effectively. There are several technique for reduction of sequential
processing, among them the elimination of lock-based sychronization, but
also the use of atomic operations and programming techniques such as lock-free
The workshop discusses the Java Memory Model, the issues of visibilty
and reordering, the use of volatile and atomic variable, the implementation
of immutable types based on the memory model's initialization safety garantee,
and provides an introduction to the techniques of lock-free programming.
In this workshop, participants have the opportunity to practice and
apply the newly gained knowledge in hands-on labs. They will review
code, spot bugs, and fix them. In addition, they will use atomic
variables to eleminate lock-based synchronisation.
Working knowledge of Java and Java concurrency.
Workshops and hands-on labs
This is a course for Java programmers who want to round up their knowledge
of Java concurrency issues.
The course is designed to build on existing expertise as Java programmers
and aims to take the skills one step further. Prerequisite for the seminar
is sound knowledge of Java concurrency and substantial practical
experience with concurrent programming in Java.
Know when to replace locks by volatile and atomics
Understand the effects of locks, volatile, final and atomics
Learn how to avoid subtle visibility bugs
Understand the principles of lock-free programming
The course is designed by Klaus Kreft & Angelika
Langer and backed by years of experience in teaching and more than a decade
of practical experience in industrial software development both in C++
is a freelance trainer/consultant in the area of software
development in C++ and Java, author of language reference material such
as the Java Generics FAQs [
the Lambdas/Streams Tutorial & Reference [
and countless articles on C++ and Java topics [
is a senior consultant for more than 25 years and has served
as the lead architect and performance expert on several successful industry
projects. He has been working in Java since its advent in 1995.
Both are recognized speakers at OO and Java conferences and author of numerous
articles on C++ and Java topics in various computer magazines worldwide.
Together they write a column for the German Java magazine JavaMagazin
and are authors of the books "Standard C++ IOStreams and Locales"
and "Java Core Programmierung" (2011) [
the Online FAQ on Java Generics [
and the Lambdas/Streams Tutorial & Reference [