Census, and possible change of time/place

29 September 2010

I’ve just sent an email to all listed APL students. However, it’s possible that some of you are not yet on the official mailing list, so I’m reproducing the content here.
Read the rest of this entry »

Lecture 3: Concurrency Abstractions

28 September 2010

Further concurrency mechanisms provided in Java. Data abstraction: ensuring consistency by using library classes for atomic actions or thread-safe datatypes such as concurrent collections. Why these are still not enough. Control abstractions: fine-grained parallelism by decomposing processes into threads, then threads into tasks. Executors in Java. Callables and futures.

At the start we had a quick recap on Amdahl’s law and I showed the simple way it is derived (see the Wikipedia page). This motivates the design of language features which allow as much concurrency as possible, while maintaining correctness! We ran out of time to cover the control abstractions, I will spend a bit of time in the next lecture covering these, but you should read the slides for the homework.

Link: Slides.


You should explore Java concurrency mechanisms in more detail, in particular, using some of the facilities provided by the java.util.concurrent packages.

  • Experiment with a program that exhibits a race condition, and make sure you can fix it in the ways described in the lecture slides.
  • Read the slides on control abstractions and write a version of the Pigeon Fancier program which uses the executor framework and allows for dynamic reconfiguration of the pigeon coop.
  • Investigate some of the explicit locking facilities provided in java.util.concurrent and make sure you can explain situations when these might be needed.

See the lecture slides for more detail. Please post questions and discussion here and we’ll follow up.

A plea. do please at least try the homeworks we are giving. We are trying to give interesting exercises and and help you structure some of the study time you need to spend for the course.

Lecture 2: Concurrency

24 September 2010

Concurrency: motivations for concurrent code; Amdahl’s law and the opportunity for language design. Challenges with concurrent code, including liveness, fairness, scalability. Threads and processes. Java Thread basics. The need for mutual exclusion. Monitors in Java: locks and synchronize, condition variables with wait() and notify().

Link: Slides


Try the exercise given at the end of the lecture slides. Sun’s tutorial on concurrency gives an introduction to the concurrency facilities provided in Java. Experimentation is essential: try the exercise and tutorial examples inside Netbeans or Eclipse and investigate the facilities for debugging concurrent code.

If you have any thoughts, problems or interesting pointers, please comment here!

Coursework Assignment

24 September 2010

The assessed coursework for APL is to research and write a report on one of the following topics:

  • Information flow in Jif
  • Programming the web with Links
  • Parallel programming in Haskell with par and seq
  • Asynchronous workflows in F#
  • Functional reactive programming in Flapjax

Preparing your report will involve reading research papers, technical manuals, and some code development on the system in question. Further details are available from the coursework webpage, including some examples of previous reports.

The lecture next Friday will review the assignment topics, and give information on preparing your report, its content and arrangement.


Do some basic research into each of the topics, in preparation for next Friday. Find out what you can, and consider which one most interests you. The lecture on Friday is a chance ask further questions about the topics, and any other issues that concern you. You can also post questions here on the blog, or by email to the lecturers.

Link: Coursework instructions

Lecture 1: What’s So Important about Language?

21 September 2010

Introduction to the course; review of some programming languages; how languages shape programs; what programming languages might do for us; some topics to be covered in the course.

Link: Slides; Sheet.


The next lecture is at 10am on Friday. It’s about programming for concurrency. Before then:

  1. Read the Wikipedia article on History of programming languages. (If you find it’s missing something, fix that.)
  2. Pick a programming language, and find out what support (if any) it offers for concurrency. Then post a brief comment here describing what you have found out. Try to avoid duplication — and no more than one language each, leave some for others.
  3. Find out about the Blub Paradox. Post citations here.

To leave comments on the blog you will need to log in: use the link in the “META” box at bottom right. The system uses your Informatics username and password. Once logged in, you can edit your profile to change how your name appears.