Angelika Langer - Training & Consulting
HOME | COURSES | TALKS | ARTICLES | GENERICS | LAMBDAS | IOSTREAMS | ABOUT | CONTACT | Twitter | Lanyrd | Linkedin
HOME 


  UPCOMING
  PREVIOUS
  MATERIALS
 
GENERICS 
LAMBDAS 
IOSTREAMS 
ABOUT 
CONTACT 
Concurrent Programming in Java

Concurrent Programming in Java  
ABSTRACT
 
Thread-Safety, Synchronization and State-Dependent Operations
Support for programming with multiple threads is a core feature of the Java programming language, yet multithreading issues are ignored by many if not most Java developers.  Even innocent classes that do not actively start and manage threads should be prepared for use by multiple threads, which raises issues of thread-safety and synchronization.
In this introductory talk we discuss the basics of thread-safety and concurrency control in general and the Java-specific features in particular.  We will also address typical problems such as the nested monitor problem and its potential for deadlocks and we will learn how to apply common techniques such as the conflict set method. 

Thread Interruption and the Java Memory Model
This tutorial aims to explain some of the more challenging details of the Java thread API.  Specifically, we look into thread termination due to an interrupt request or due to an uncaught exception.  We will answer questions such as: How does thread interruption work?  Why are the methods suspend() and resume() deprecated?  What do we do instead? How do we gracefully terminate a thread in response to a thread interruption?  What is the effect of uncaught exceptions on active threads?   How can we avoid that an uncaught exception prematurely terminates a thread?
Another less commonly known topic is the Java memory model, which has certain problems with atomicity and sequential consistency of access to volatile variables.  The Java language specification gives guarantees for volatile variables, but not all Java implementations actually meet these requirements.  As Java developers we would like to know which guarantees we can rely on and which areas we should better avoid.

Concurrency Control Patterns
This tutorial discusses patterns for concurrency control and how they can be implemented in Java. We will look into various incarnations of the adapter pattern and will se which kinds of adapters are relevant in concurrent programming (immutablity adapters, synchonization adapters). We will learn how to implement a reader-writer pattern in Java, including the before-after-technique.  We will talk about patterns for thread conpletion (like future, callbacks, group proxies).
The tutorial is of interest to Java programmers, but also to developers who implement concurrent programs in related languages such as C++.
 

 
PREREQUISITES

 
Level: intermediate / advanced
Duration: 90 min -  full day
Prerequisites: Attendants should be familiar with Java and the core concepts of concurrent programming in Java.
Presented at: OOP 2003 , Munich, Germany, January 2003
ACCU Conference , Oxford, UK, April 2003
ROOTS , Bergen, Norway, May 2003

 
 

If you are interested to hear more about this and related topics you might want to check out the following seminar or skim through some further reading:
Seminars
Concurrent Java
3-day seminar (open enrollment and on-site)
 
Papers
Effective Java
column in JavaSPEKTRUM (in German)
 

 
 
  © Copyright 1995-2008 by Angelika Langer.  All Rights Reserved.    URL: < http://www.AngelikaLanger.com/Conferences/Abstracts/AdvancedMultithreading.htm  last update: 5 May 2008