CS 361 Concurrent Programming - Syllabus

Term and Credits

Fall 2023-2024
3 Credits

Room and Time

Section 001 - MW 3:00PM-4:20PM Prof. Boady [3675 Market Street Room 1104]
Section 002 - MW 4:30PM-5:50PM Prof. Boady [3675 Market Street Room 1104]

Instructor

Mark Boady
Electronic Mail Address: mwb33@drexel.edu
Office: 3675 Market Street Room 1063 (near snack machine)
Extention: 215-895-2347
Office Hours: Tuesday and Thursday 12-1PM

Teaching Assistant(s)

Janaki Nair
Electronic Mail Address: jn687@drexel.edu
Office: CLC 3675 Market Room 1066
Office Hours: Monday 12:00-2:00PM, Friday 2:00PM-4:00PM

Course Description

Covers programming of concurrent, cooperating sequential processes. Studies race conditions, critical sections, mutual exclusion, process synchronization, semaphores, monitors, message passing, the rendezvous, deadlock, and starvation.

Course Objective and Goals

  1. Acquaint you with the general principles of concurrent programming and the concepts and basic algorithms for cooperating sequential processes and threads such as locks, semaphores, condition variables, lock-free techniques, and message passing. The course expects students to attain proficiency with the terminology of concurrent programming.
  2. Handle the more practical aspects of developing correct and efficient multi-threaded or multi-process programs in a variety of languages while doing applied problem-solving. This is a balance between having the time to learn idiomatic programming and software development in a primary language and being able to develop generalized expertise that can be transferred to work in multiple languages. Students are expected to be able to design and implement multithreaded concurrent programs that require significant amounts of control and coordination between threads, while achieving good performance in multicore/multiprocessor environments.
  3. Achieving "deeper understanding": Being able to talk about concurrency situations using abstraction and abstract (formal logic) reasoning. Knowing enough about the subject to be able to transfer your learning to new situations: new problems, different programming languages, or using reading experimentation and reflection to grow your learning as concurrent technology evolves. Establishing correctness and good performance for concurrent programs can confound efforts without such understanding since matters can often be much more complicated than in sequential programs.

Topics

  1. Computer architecture concepts that support concurrency: review of threads, and processes.
  2. Shared Memory with multi-threaded computation: Race Conditions, Mutual Exclusion with locks.
  3. Proof techniques for correctness.
  4. Semaphores
  5. Classic Concurrency Problems
  6. Conditional Variables
  7. Multi-process or distributed concurrency through message passing.
  8. Concurrent and parallel performance

Audience and Purpose within Plan of Study

Students who take this course will learn how to develop good quality multi-threaded and parallel software. There are many application areas (mobile, gaming, operating systems) where knowledge of how to properly use concurrency is essential. However, the thorniness of figuring out what a concurrent program is allowing and disallowing undesirable execution paths means learning more than how to invoke a few new control statements or code libraries. This is an area where a programmer's ability to explain "why it works" is important as the inventiveness to generate a program that specifies "how it works". In order to write code that works, students of concurrent programming need learn and master new ways of understanding the behavior of programs. This requires some rigor, reliance on abstraction, and attention to detail and form. We try to make this accessible and as non-scary as we can, but there’s no avoiding the learning effort. If you don't have a minimum of five hours outside of class every week to work on this course, our experience with your predecessors indicates that you'll have a hard time getting past the minimum requirements. "Work hard just before the assignments are due" isn't usually sufficient.

Prerequisites
This subject benefits from the abilities to creatively use the software development and mathematical tools that students know as advanced undergraduates: CS260 (minimum Grade D), CS281 (minimum Grade D) or CS283, or equivalents, CS 270 (logic and proof from Mathematical Foundations of Computer Science).

What Students Should Know Prior to this Course

  1. Knowledge of a low level programming language (C, assembly, etc)
  2. Some experience with a Object Oriented Language (C++, Java, etc)
  3. A basic understanding of how the OS switches between processes
  4. Experience with Logical reasoning and Proofs

What Students will be able to do upon Successfully Completing this Course

  1. Students will be able to design, implement, and test multi-threaded applications that meet performance and correctness expectations for good quality, and be able to transfer such expertise to new languages.
  2. Students will be able to write applications in which threads or processes coordinate in the presence of dependencies, and be able to transfer such expertise to new languages.
  3. Students will be able to prove the correctness of simple concurrent algorithms using logic and through model checking, and be able to transfer such expertise to new languages.
  4. Students will be able to assess performance and make appropriate design and implementation decisions for multi-threaded or multi-process programs, and be able to transfer such expertise to additional programming languages.
  5. Students should also be able to extend their knowledge about concurrency incrementally in a straightforward fashion, having acquired the fundamental building blocks for understanding and learning about concurrency in this course.
  6. Students will be able to communicate their explanations and justifications for their concurrent programs effectively to others with a comparable background.

Textbook

C++ Concurrency in Action (Second Edition)
Author: Anthony Williams
Published: February 10, 2019
ISBN-10: 1617294691
ISBN-13: 978-1617294693
Buy from Amazon
Online Edition from Manning

Recommended Supplemental Material

Tour of C++ (3rd Edition)
Author: Bjarne Stroustrup
Published: September 24, 2022
ISBN-10: 136816487
ISBN-13: 978-0136816485
Buy from Amazon
Online From Drexel Library

Grading and Policies

Final grades will be determined by your total points weighted according to this distribution. Grades may be curved but are generally computed via the formula below. It may be modified at the instructor's sole discretion, but letter grades will generally not be lower than those shown here.

Course Material

Late Policy

Academic Honesty Policy

The CCI Academic Honesty policy is in effect for this course. Please see the policy at http://drexel.edu/cci/resources/current-students/undergraduate/policies/cs-academic-integrity/.

Academic Honesty Violations will be reported to the University. Punishment will be determined by the severity of the incident. Punishments include, but are not limited to,


Components

Attendance

There are a total of 19 lectures in the term. You are not required to attend them all to get full credit. Scoring for attendance is as follows:

Reflection Essay

Each week you will need to write a short reflection on the topics you learned the previous week.

Homework Assignments

There will be one homework assignment per week. It will normally contain multiple components. Some programming and some written.

Assessments

There will be two self assessments. You will answer a series of essay questions about content in the class so far. You will propose a letter grade for your progress and skill on the material.

Extra Credit

In this course, we value the course survey results. It is important for you to receive grades so you can determine how you are performing in class. We also want to know how we are doing. The course survey is our most important tool for determining how the students feel about the class. We also understand that completing the survey takes time and effort. Due to the importance of the course survey, extra credit will be provided to those students who complete it and provide evidence it has been completed. The extra credit will be 1 point added to the final grade for the class. This will take place at the end of the term.


University Policies
In addition to the course policies listed on this syllabus, course assignments or course website, the following University policies are in effect:

CCI's Commitment to Diversity, Equity, and Inclusion (DEI)

The College of Computing & Informatics commits to creating a positive and safe learning environment for everyone - instructors, professional staff, and students – both inside and outside of the classroom. We embrace the diversity of thoughts, perspectives, and experiences that each community member brings, and we honor everyone's identity (including, but not limited to, race, ethnicity, age, gender, socioeconomic status, sexuality, religion, veteran status, and disability). We encourage each community member to share information regarding pronouns, religious and cultural holidays, accommodations, and any other information that will assist instructors in fostering a supportive and inclusive community environment. For more information about CCI's commitment to DEI, visit Diversity, Equity & Inclusion Council | Drexel CCI.

Appropriate Use of Course Materials

It is important to recognize that some or all of the course materials provided to you are the intellectual property of Drexel University, the course instructor, or others. Use of this intellectual property is governed by Drexel University policies, including the IT-1 policy found at: https://drexel.edu/it/about/policies/policies/01-Acceptable-Use/
Briefly, this policy states that all course materials including recordings provided by the given prior written approval by the University. Doing so may be considered a breach of this policy and will be investigated and addressed as possible academic dishonesty, among other potential violations. Improper use of such materials may also constitute a violation of the University's Code of Conduct found at: https://drexel.edu/cpo/policies/cpo-1/ and will be investigated as such.

Recording of Class Activities:

In general, students and others should not record course interactions and course activities in lecture, lab, studio or recitation.
Students who have an approved accommodation from the Office of Disability Resources to record online lectures and discussions for note taking purposes should inform their course instructor(s) of their approved accommodation in advance. The recording of lectures and discussions may only be carried out by the students enrolled in the class who have an approved accommodation from Disability Resources with their instructors' prior knowledge and consent. Students with approved accommodations may be asked to turn off their recorder if confidential or personal information is presented.
If a student has any comments, concerns, or questions about provided class materials and/ or recording, talk to your course instructor first. If this does not resolve the issue, you can also reach out to the Department Head, and use the process described for a grade appeal to move your concern forward. The process described for grade appeals can be found at: https://drexel.edu/provost/policies/grade-appeals/

Tentative Course Schedule

Please see the appropriate assignment webpages for a detailed description of course deliverables.

Week Topic Assignments
1 (September 25, 2023)
University Holiday 9/25/23
Campus Closed Monday
Lecture 01 - Concurrency Theory
Reflection 1 - Due Wednesday 9/27 at 11:59PM
2 (October 2, 2023) Lecture 02 - Lock and Semaphore Theory
Lecture 03 - CPP Introduction
Reflection 2 - Due Wednesday 10/4 at 11:59PM
Assignment 1 - Due Friday 10/6 at 11:59PM
3 (October 9, 2023)
Indigenous People's Day 10/2/23
Campus Closed Monday
Lecture 04 - CPP Thread Basics
Reflection 3 - Due Wednesday 10/11 at 11:59PM
Assignment 2 - Due Friday 10/13 at 11:59PM
4 (October 16, 2023) Lecture 05 - Case Study: Mandelbrot Set
Lecture 06 - Objects in CPP
Reflection 4 - Due Wednesday 10/18 at 11:59PM
Assignment 3 - Due Friday 10/20 at 11:59PM
5 (October 23, 2023) Lecture 07 - Locks and Condition Variables
Lecture 08 - Semaphores
Reflection 5 - Due Wednesday 10/25 at 11:59PM
Assignment 4 - Due Friday 10/27 at 11:59PM
6 (October 30, 2023) Lecture 09 - Producer-Consumer Problem
Lecture 10 - Reader-Writer Problem
Reflection 6 - Due Wednesday 11/01 at 11:59PM
Midterm Assessment - Due Friday 11/3 at 11:59PM
7 (November 6, 2023) Lecture 11 - Quicksort + Async
Lecture 12 - Dinning Philosophers (Part 1)
Reflection 7 - Due Wednesday 11/8 at 11:59PM
Assignment 5 - Due Friday 11/10 at 11:59PM
8 (November 13, 2023) Lecture 13 - Dinning Philosophers (Part 2)
Lecture 14 - Concurrent Queues
Reflection 8 - Due Wednesday 11/15 at 11:59PM
Assignment 6 - Due Friday 11/17 at 11:59PM
9 (Novmber 20, 2023)
Thanksgiving 11/22-11/24
Lecture 15 - Channels
Closed Wednesday - Friday
None
10 (November 27, 2023) Lecture 16: Thread Pools
Lecture 17: Map-Reduce
Reflection 9 - Due Wednesday 11/29 at 11:59PM
Assignment 7 - Due Friday 12/1 at 11:59PM
11 (December 4, 2023) Lecture 18: Lamport's Bakery Algorithm
Lecture 19: Lock-Free C++
Reflection 10 - Due Wednesday 12/6 at 11:59PM
Assignment 8 - Due Friday 12/8 at 11:59PM
12 (December 11, 2023) Final Assessment - Due Wednesday 12/13 at 11:59PM
Extra Credit Survey - Due Wednesday 12/13 at 11:59PM