IT-Universitetet i København
  Tilbage Kursusoversigt
Kursusnavn (dansk):Practical Concurrent and Parallel Programming 
Kursusnavn (engelsk):Practical Concurrent and Parallel Programming 
Semester:Efterår 2016 
Udbydes, softwareudvikling og -teknologi (sdt) 
Omfang i ECTS:7,50 
Min. antal deltagere:
Forventet antal deltagere:60 
Maks. antal deltagere:85 
Formelle forudsætninger:Students must know the Java programming language very well, including inner classes, generics, and a first exposure to threads and locks, and event-based graphical user interfaces as in Swing or AWT. 
Læringsmål:After the course, the student should be able to:

* ANALYSE the correctness of concurrent Java software, and RELATE it to the Java memory model
* ANALYSE the performance of concurrent Java software
* APPLY Java threads and related language features (locks, final and volatile fields) and libraries (concurrent collections) to CONSTRUCT correct and well-performing concurrent Java software
* USE software tools for accelerated testing and analysis of concurrency problems in Java software
* CONTRAST different communication mechanisms (shared mutable memory, transactional memory, message passing) 
Fagligt indhold:In this course you learn how to write correct and efficient concurrent and parallel software, primarily using Java, on standard shared-memory multicore hardware such as laptops, desktops and servers. The course covers basic mechanisms such as threads, locks and shared memory as well as more advanced mechanisms such as functional parallel stream operations, transactional memory, message passing, and lock-free data structures implemented using atomic compare-and-swap instructions. It covers concepts such as atomicity, safety, liveness and deadlock. It covers how to measure and understand performance and scalability of parallel programs. It covers tools and methods to find bugs in concurrent programs, and reason about their correctness.

Topics covered include:

* Threads and locks in Java, shared mutable memory, mutual exclusion, atomic operations, avoiding sharing (thread confinement, stack confinement), designing thread-safe classes, the Java monitor pattern, object graph sharing.
* Visibility, volatile, immutable objects, final, the Java memory model.
* Functional programming, stream pipelines for bulk data, parallel operations on streams and arrays.
* Performance and scalability, performance measurements, scalability case studies: concurrent hashmap, parallel quicksort.
* Tasks, the Java executor framework, concurrent pipelines, blocking queues.
* Concurrency and single-threaded GUI applications.
* Testing concurrent programs, correctness, safety and liveness concepts, deadlock, livelock, tools.
* Transactional memory, the Multiverse library.
* Optimistic concurrency, lock-free data structures, Treiber stack, compare-and-swap, the Michael and Scott queue, progress concepts, how to implement a lock.
* Message passing concurrency, concepts from Erlang, the Java Akka framework. 
Læringsaktiviteter:14 ugers undervisning bestående af forelæsninger og øvelser

14 weeks of teaching consisting of lectures and exercises, some of which are mandatory hand-ins. The written take-home examination, which emphasizes construction, measurement and reflection, is closely aligned with the intended learning outcomes. The weekly exercises facilitate independent understanding and practical skills in implementing and empirically evaluating the software concepts taught in the course. As learning activities, doing the exercises enable the students to perform according to the intended learning outcomes, including but not limited to passing the exam. 

Obligatoriske aktivititer:5 out of 6 bi-weekly mandatory hand-ins have to be approved as prerequisite for taking the exam.

Be aware: The student will receive the grade NA (not approved) at the ordinary exam, if the mandatory activities are not approved and the student will use an exam attempt 
Eksamensform og -beskrivelse:C: Skriftlige arbejder uden mundtlig eksamen., (7-scale, external exam)

Written take-home exam (individual mini-project)
- Total duration 30 hours
- Expected exam workload 16 hours
- Individual
- Date and time for exam publication and solution hand-in will be published in LearnIT.
- Submission in LearnIT
- All materials, including Internet access, allowed
- Plagiarism, collaboration and copying of solutions not allowed.
- There is no oral exam but a fraud check will be conducted after the hand-in. The study administration will randomly select 20 % of students who will have to show up at ITU to check authorship of submitted solutions. The selection of students and the place and time for the fraud check will be published in Learn IT.  

Litteratur udover forskningsartikler:* Goetz et al: Java Concurrency in Practice, Addison-Wesley 2006. Book homepage:
* Herlihy and Shavit: The Art of Multiprocessor Programming. Revised first edition, Morgan Kaufmann 2012. Chapters 1, 3, 18.1, 18.2.
* Sestoft: Microbenchmarks in Java and C#. Lecture notes, IT University of Copenhagen 2015.
* Sestoft: Java Precisely 3rd edition, MIT Press 2016, sections 11.13, 11.14, 23, 24, and 25.
* The Multiverse Software Transactional Memory library documentation.
* Armstrong, Virding, Williams: Concurrent Programming in Erlang.