Concurrent Programming

This is an old web-page preserved only for historical reference. A lot of the information in this web-page is outdated and very likely does not apply to the current course anymore!
Please, for Spring term 2008 visit the new location

Latest News and General Information

  • (3/9) The new web-page for Autumn term 2007 has a new location. Click here to get the most up-to-date information. This web-page is going to be preserved for historical reference.
  • (2/4) Tentagranskning Monday April 16 at 12:00 at 5453.
  • (29/3) The exams and labs have been graded and all results have been passed to the student office.
  • (7/3) Office hours for Lab 3: see Prasad at office 5469 on Friday, March 9, 10-12.
  • (6/3) Please take a minute and give feedback by filling in our anonymous web-based course questionnaire.
  • (3/3) Final deadline for lab 2 is extended to March 16.
  • (19/2) Guest lecture, Wed, Feb 28, 10-12, HB2: Urban Boquist (Ericsson) will talk about Industrial use of Erlang.
  • (19/2) The order of lectures 9-13 has been changed.
  • (6/2) Lab reporting system is online
  • (1/2) By popular demand, there is a faster version of the train simulator installed on Solaris machnines (including persephone): /users/mdstud/ppvt/sw/sparc_solaris/bin/tsim_quick. We have also installed tsim_fast (which should be already in your path after running setup_course) on Linux machines. This version is for experiments only. You might get crashes for correct solutions because input/output pipes might not be fast enough to communicate commands to the simulator in time.
  • (29/1) Slight adjustments in the timetable.
  • (29/1) Note the requirements on command line parameters for lab 1.
  • (29/1) If the below way to get setup_course TDA380 on persephone.medic.chalmers.se does not work, type PATH=/users/mdstud/ppht/sw/sparc_solaris/bin:$PATH in your zsh (or bash) prompt. If even this does not help, contact ITS (former MEDIC).
  • (25/1) If your shell is not tsch, you might not have any effect of setup_course TDA380 on persephone.medic.chalmers.se. To resolve the problem, run tsch before setup_course TDA380.
  • (23/1) Added a note on labs passed in previous iterations of the course.
  • (19/1) Slight adjustments in the timetable.
  • (17/1) Syntax highlighting for MPD:
    • Emacs users can achieve it with the SR-Mode for Emacs. Save this file to your home directory and add the following lines to your .emacs file.
         ;; for sr-mode
         (setq auto-mode-alist (append '(("\\.mpd$" . sr-mode)) auto-mode-alist))
         (autoload 'sr-mode "~/sr-mode.el" "SR mode" t nil) 
         
      A simpler alternative (but not as MPD-specific) is
      M-x c-mode
      You have to put all the semicolons for indentation support though.
    • nedit users, on Solaris run
         > nedit -import /users/mdstud/ppvt/mpd.nedit 
         
      or on Linux machines run
         > nedit -import /chalmers/courses/TDA381/mpd.nedit 
         
      Then choose from the menu Preferences -> Save Defaults -> OK
  • (17/1) In order to make sure you're using the right version of the MPD compiler, don't forget to run setup_course TDA381 on Linux machines (or setup_course TDA380 on Solaris). FYI, persephone.medic.chalmers.se is a multiprocessor (Solaris) machine. To get the MPD runtime system to schedule threads on persephone's several processors, do the following.
    setup_course TDA380
    setenv MPD_PARALLEL 4
    
    You are strongly encouraged to test your lab solutions on persephone with these settings.
  • (17/1) Omtenta schedule.
  • (17/1) Web site updated for Spring 2007.

From the course plan:

"Concurrent programming plays a vital role in systems where many events appear to occur simultaneously. This course aims to provide an introduction to the problems common to concurrent systems such as operating systems, distributed systems and real-time systems, and practical knowledge of the programming constructs and techniques offered by modern concurrent programming languages."
cover picture

General

Language resources

Full Timetable

Lectures

  • Overview of the lectures, and copies of overheads.

Exercises

Assignments (Labs)

Examinations


Lecturer

Lecturer

Tutors and Lab Supervisors

For exercises, lab supervision and grading, the lecturer will be joined by Aslan Askarov, Mattias Kettil, Daniel Larsson, K.V.S. Prasad, Alejandro Russo.

Course Book.

This is a course about the fundamentals of concurrent programming. It has both a conceptual component and a practical one. The course textbook is Foundations of Multithreaded, Parallel and Distributed Programming by Greg Andrews. Addison Wesley, ISBN 0-201-35752-6.

Reading guide

The following table lists the part of the course book covered by the course.
Chapter
1 all
2 all
3 all, except 3.4.3, 3.5
4 all, except 4.6
5 all, except 5.3, 5.5
6 only 6.5
7 all, except 7.3.2, 7.3.3, 7.8, 7.9
8 all, except 8.1.3, 8.4.2, 8.5
10 only 10.1 and 10.2

Additional Reading (Java)

There are many other books on multithreaded programming in Java that you could refer to, and are easily found on the web. For example a comparative review of 6 books. The focus of these books differs somewhat from that of our course.

Some quick comments on two books.

Many Java books have a brief chapter on concurrency. A fair example is the chapter in "Object-Oriented Software Development Using Java", by Xiaoping Jia, Addison Wesley.

Visit also the local Java page which contain some on-line Java sources.


Programming languages

The concepts are taught from the course literature. In tutorials and labs this is complemented by practical work.

The practical component is taught by three programming assignments ("labs"). The first two are to be done in MPD or Java. The lectures will use MPD to illustrate a wide range of programming techniques, but we will also illustrate concurrency aspects of Java fairly extensively. Everyone on the course will need to program in either MPD or Java. The exam questions will mainly use MPD, but an understanding of the synchronisation aspect of Java programs will also be expected.

All students also need to learn Erlang to do the third lab and for the exam. A necessary subset of Erlang will be covered in the lectures.

The MPD Language

There is some information about the programming language used with the course. It has a syntax which is based on the book, and is a minor modification of the language SR. Please note that the syntax in the book is unfortunately not the syntax of the MPD language. For information about the MPD language visit David Sands and Daniel Hedin have produced a language reference guide for the sequential parts of MPD. See the local MPD page for details.

Course Computer Account

ITS does not create course accounts anymore. Each student is to use his/her own account.

You will be expected to find a lab partner, with whom you will go to exercises and do the assignments. Since the labs for this course take a lot of work to grade, you are required to find a lab partner. One-person groups are allowed only for a well justified reason and only with a permission from the lecturer.

To set up your account run setup_course TDA381 on Linux machines (or setup_course TDA380 on Solaris). This will activate necessary compilers and programs. If your shell is not tsch, you might not have any effect of setup_course TDA380 on persephone.medic.chalmers.se. To resolve the problem, run tsch before setup_course TDA380. If this does not work, type PATH=/users/mdstud/ppht/sw/sparc_solaris/bin:$PATH in your zsh (or bash) prompt. If even this does not help, contact ITS (former MEDIC).


Overview of the Lectures

Lecture notes will be available on-line before the lecture so you can bring them to the lecture to do notes and (in case of errors) corrections. Last year's lectures are already on the web, but changes and updates may be done before the actual lecture. If these updates are substantial then it will be indicated in the latest news section. Slides are only available from within Chalmers/GU, sgsnet.se, etc. Let us know if you need access from elsewhere.

Note on printing out lecture slides: Choose 6/page version

  1. Introduction to the course. The goal of the course. Course Materials. The basic concepts of parallelism and concurrency. Copies of lectures:
    for viewing on screen or for printing (6/page)
  2. The shared update problem; Peterson's algorithm. Introduction to semaphores and locks. Copies of lectures:
    for viewing on screen or for printing (6/page)
  3. Semaphores; dining philosophers and Producer-consumers/buffers.
    for viewing on screen or for printing (6/page). Book chapter 4.
  4. Monitors.
    for viewing on screen or for printing (6/page). Book chapter 5.
  5. Monitors continued. Java's monitors.
    for viewing on screen or for printing (6/page). Book chapter 5.
  6. Introduction to Message Passing
    for viewing on screen or for printing (6/page). Book Part II; Chapter 7.
  7. Message Passing continued. Rendezvous and the in statement.
    for viewing on screen or for printing (6/page). Chapter 8.
  8. Part I: Timing and soft real time. Part II: Linda (Chapter 7.7).
    for viewing on screen or for printing (6/page).
  9. Erlang.
    for viewing on screen or for printing (6/page).
  10. Erlang, continued.
    for viewing on screen or for printing (6/page).
  11. Guest lecture, Wed, Feb 28, 10-12, HB2: Urban Boquist (Ericsson) will talk about Industrial use of Erlang.
  12. Reasoning about concurrent programs. (Chapter 2.6). Implementations. (Chapters 6 and 10).
    for viewing on screen or for printing (6/page).
  13. Course Summary; Exam Info.
    for viewing on screen or for printing (6/page).

Exercises

There are three alternative exercise (övning) sessions per week. These will be much like ordinary "handledning" (lab supervision), but with the intention that you work on that week's exercises.

This is a good chance to get to know MPD, or to learn through small practical experiments.

You should come to exercises with your lab partner. Please do not come to more than one class per week - to give others a chance to attend. See the schedule for times. Because of the limited space we strongly discourage you from using the exercise time for laborations. Students using the exercise time to do laborations may be asked to leave to make room for students wanting to to the exercises.

Changing between sessions is fine, as long as there is room. Space is very limited, but many will choose to try the exercises in their own time.

Overview of Exercises

  1. Introduction to Concurrency and Critical Sections. Trying out semaphores and locks. Chilling out. Exercise 1.
  2. Using Semaphores for conditional synchronisation. Dynamic process creation and more. Exercise 2
  3. Sieves and Bridges. Exercise 3
  4. Receiving multiple messages/Waiting on multiple events. Exercise 4
  5. Replicated Workers: Java, MPD and Erlang Exercise 5
  6. Some simple "Getting Started" exercises in Erlang You should look at this first before doing the replicated workers example in Erlang, which is much harder.
Solutions to these exercises are made available some time after respective exercise sessions.

Assignments

There are three assignments ("laborations") for all students.

MPD or Java should be used for the two first laborations, and Erlang for the third.

You will need a partner to complete the assignments. To complete the assignments in any other form of a group (or alone) you will need a very good reason and a permission from the main course responsible.

There is a list of times when one of us will be available to help out in a computer room.

IMPORTANT: Last grading date

All labs must be submitted by the deadline. All corrections to labs ("retur") must be resubmitted within the two weeks following the deadline. No labs submitted more than two weeks after the deadline will be graded. This is a firm limit.

Assignment (Laborations) Deadlines

Assignment 1 (Trainspotting)
Assignment 2 (The Pub) is due
Assignment 3 (Tuplespace) is due

When finished you should submit your assignment for correction.

Note: If you have passed some labs in previous years, you do not resubmit the solutions. Instead, you do have to submit text files for each lab with the information on when you passed it and if you are a Chalmers or GU student (for example: "Passed in VT06; Chalmers student") so that we can check it.


Course Requirement and Examinations

To pass the course, you must have passed the labs and have passed the exam. See the exam schedule (including omtenta) for TDA211/TDA380/TDA381/INN390 Concurrent Programming. The only permitted material is a dictionary.

Credits

Course founded by David Sands. Modified by K.V.S. Prasad, Andrei Sabelfeld, Björn von Sydow, and Karol Ostrovský.

Valid HTML 4.01! Last modified: Monday, 31-Aug-2009 15:18:44 MET DST