The concepts are taught from the course literature. In execise sessions and assignments this is complemented by practical work.

The practical component is taught by four programming assignments (labs). The first two are to be done in Java, and the third and four in Erlang. The lectures will illustrate a wide range of programming techniques in Java and Erlang extensively. Everyone on the course will need to program in Java and Erlang.

All students also need to learn Erlang to do the third and four assignment and for the exam.

Java resources

Oracle's Java tutorial and in particular the section Concurrency It contains nice small examples as well. It is a part of Essential Java Classes that also contains nice information about Streams and exception handling.

If you want to know more about Java we also recommend the language specification. Chapter 17 deals with threads and locks. It contains very valuable information for anyone trying to write something concurrent in Java.

We do not talk much about memory models in this course, but it is a very important issue. For everyone using advanced concurrency features in Java, this FAQ on the current memory model in Java is a must read.

Swing and threads

The Java Swing framework has several problems in connection with multi-threaded programs. This page introduces some of them.

In a Swing program there is always one thread executing that is not visible in the user source code: the event-dispatching thread. This thread executes all code in event handlers (listeners), for example in actionPerformed, mouseClicked, etc. These event handlers typically update both program state and the GUI. Thus, it is essential that all user code that causes GUI updates executes in this thread to avoid race conditions, with different threads concurrently manipulating the GUI. One exception to this rule is the creation of the GUI at program startup, which is often done in the main thread. This is (almost) OK, as long as all the creation work is done before the GUI is realized (made visible on screen).

Erlang resources

The following links may be useful: