ECE 252


Systems Programming and Concurrency

Spring 24

Details


Time & location

Lectures: Tu, Th 11:30 - 12:50, E7 4053

Tutorials: M 16:00 - 17:20, E7 4053

Labs: W, Th, F 8:30 - 11:20, E2 3339

Lectures will be in-person and regular attendance is expected. All make-up lecture slots (May 24, Jun 14, Jul 5, and Jul 26; 13:00 - 14:20; E7 4053) will be used unless indicated otherwise by the course instructor. Tutorial sessions are held only if there is a prior announcement by instructors. Lectures and tutorials will be paused during the midterm week.

Teaching team
Prof. Seyed Majid Zahedi

Instructor

Prof. Seyed Majid Zahedi

Book appointments here

Maran Ma

Lab instructor

Maran Ma

Sheikh Abrar Tahmid

Grad TA

Sheikh Abrar Tahmid

Elly Khodaei

Grad TA

Elly Khodaei

Olha Vakulenko

Grad TA

Olha Vakulenko

Description
This course covers the following topics: processes and threads (pthreads), system calls, concurrency (semaphore, mutex, monitors, and barrier synchronization), user-level memory management, performance and correctness of concurrent systems, deadlock detection and recovery, and file systems.
Prereq

ECE 250; Level at least 2B Computer Engineering or Electrical Engineering

This course requires substantial programming skill. The basics of the C language will be reviewed briefly, and should be familiar to anyone who has already used C++.

Antireq
CS 343, CS 350, ECE 254, SE 350
Readings

Main textbook

  • W. Richard Stevens and Stephen A. Rago: Advanced Programming in the UNIX Environment, 3rd edition, Addison-Wesley, 2013. ISBN: 978-0-321-63773-4.

Optional reference

  • Michael Kerrisk: The Linux Programming Interface, No Starch Press, 2010. ISBN: 978-1- 59327-220-3.
Evaluation

Coursework will include the following components.

  • Assignments (10%)
  • Lab projects (40%)
  • Final (50%)

There are three equally weighted programming assignments, for a total of 10%. Assignment grading is on a 0-1-2 basis: 0 if not attempted or does not work at all, 1 if there are some issues, and 2 if everything works as expected.

There are five lab projects, and the grading policies are specified in the lab manual (available on LEARN).

Course objectives

Students who complete the lecture component of the course successfully will be able to:

  • Invoke (apply) system calls, from the view of an application programmer, to access resources like files, inter-process communication mechanisms, and the network.
  • Analyze, design, implement, and debug concurrent C programs, using concurrency control constructs (such as a mutex or semaphore).
  • Apply standard concurrency scenarios such as producer-consumer, readers-writers, dining philosophers, as well as deadlock and starvation.

Students who complete labs successfully will be able to:

  • Interact with the Linux operating system through the command-line interface and the C language API.
  • Read the documentation of, understand, and interact with available libraries such as those for multi-threading, files, and network operations.
  • Use inter-process communication such as shared memory.
  • Identify, analyze, and solve concurrency and synchronization problems.
Acknowledgment

Lecture materials, assignments, and portions of this course outline were provided by Jeff Zarnett and Wojciech Golab.

Announcements


Jul 23
There will be no make-up session on Jul 26th.
Jun 6
The deadline for Lab2 is extended to Jun 10.
May 14
There will be no regular lectures on May 21 and 23.
Apr 29
Please sign up for the course on Piazza.

Schedule (tentative)


Week Dates Topics Lectures Events

1

May 6 - May 10

introduction

system calls

L01: slides, notes

L02: slides, notes

May 12: Group sign-up deadline

2

May 13 - May 17

file systems

processes

UNIX processes

L03: slides, notes

L04: slides, notes

L05: slides, notes

May 13: Lab1 tutorial

3

May 20 - May 24

inter-process communication

L06: slides, notes

No regular lectures

May 24: Make-up session

May 24: Lab1 deadline

4

May 27 - May 31

sockets

network communication

L07: slides, notes

L08: slides, notes

May 27: Lab2 tutorial

May 31: A0 deadline (optional)

5

Jun 3 - Jun 7

pipes

threads

concurrency

L09: slides, notes

L10: slides, notes

L11: slides, notes

Jun 7: Lab2 deadline (extended)

6

Jun 10 - Jun 14

synchronization

semaphores

synch. patterns

monitors

L12: slides, notes

L13: slides, notes

L14: slides, notes

L14-2: slides, notes

Jun 10: Lab2 deadline

Jun 10: Lab3 tutorial

Jun 14: Make-up session

Jun 14: A1 deadline

7

Jun 17 - May 21

ECE MIDTERM WEEK

8

Jun 24 - May 28

producer-consumer

readers-writers

L15: slides, notes

L16: slides, notes

9

Jul 1 - Jul 5

deadlock

deadlock avoidance

deadlock detection and recovery

advanced concurrency

L17: slides, notes

L18: slides, notes

L19: slides, notes

L20: slides, notes

Jul 1: Lab4 tutorial

Jul 2: Lab3 deadline

Jul 5: Make-up session

10

Jul 8 - Jul 12

atomic types

analysis tools

Byzantine generals

L21: slides, notes

L22: notes, video

L23: slides, notes

Jul 8: A2 deadline

11

Jul 15 - Jul 19

concurrency in file systems

more concurrency in file systems

asynchronous I/O

L24: slides, notes

L25: slides, notes

L26: slides, notes

Jul 15: Lab4 deadline

Jul 15: Lab5 tutorial

12

Jul 22 - Jul 26

more asynchronous I/O

event-driven IO

L27: slides, notes

L28: slides, notes

Jul 22: A3 deadline

Jul 26: Make-up session

13

Jul 29 - Aug 2

final exam review (time-permitting)

Jul 29: Lab5 deadline

Jul 30: A4 deadline (optional)

Resources


Lectures

GitHub repository

Code examples

GitHub repository

Reference sheet

GitHub repository

Sample exams

Waterloo ECE252

Waterloo ECE350

Waterloo SE350

Berkeley CS162

Policies


Lateness

Late assignment submissions will be penalized 15% per day (for a maximum of two days) and there will be no grace days. The instructor reserves the right to reconsider the penalty for students who are struggling due to illness or personal issues. Late submission of labs will be subject to the policies defined in the lab manual. Short-term absence self-declarations cannot be used to declare absence for the LAB component of a course. They can still be declared for the other components of the course.

Illness

Accommodations such as due date extensions and re-weighting of deliverables will be considered in accordance with existing department-level, faculty-level, and university-level policies. Missed deliverables due to prolonged illness will normally be replaced with the final exam grade.

Students with chronic health problems that affect their ability to complete coursework should register with AccessAbility Services.

Collaboration and group work

Assignments will be completed individually, and labs in groups as specified in the lab manual. Lightweight discussions between individuals and lab groups are permitted, but solutions should be developed independently.

Copying material from other groups, from other courses, or from online sources is forbidden except for materials authorized explicitly by the teaching team.

Code should never be shared electronically with classmates except among members of the same lab group, or with the instructor's permission.

Unauthorized collaboration and copying of material constitute academic offences under Policy 71.

Your code may be checked for plagiarism using MOSS or Turnitin.

Piazza

Please be respectful and polite when posting in Piazza. Feel free to ask for clarification regarding the requirements for a coursework deliverable, or ask general technical questions, but do not post information (e.g., code fragments) that gives away a substantial part of the solution.

Re-marking

If you believe that your grade on an assignment is incorrect, you may ask that it be re-marked. To request that a question be re-marked, you will need to submit your request in writing via e-mail to the instructor. Requests for re-marking may be submitted any time before the final exam. When you submit your request, it should include the following: (1) Your name and student ID number; (2) a clear indication of which question or part of the deliverable is to be re-marked; and (3) an explanation of why you believe the grade assigned was incorrect. Be forewarned, when a deliverable is being re-marked, your grade could go up, it could stay the same, or it could go down. You will be notified in writing of the outcome.

Academic integrity

In order to maintain a culture of academic integrity, members of the University of Waterloo community are expected to promote honesty, trust, fairness, respect and responsibility. Check the Office of Academic Integrity for more information.

Grievance

A student who believes that a decision affecting some aspect of his/her university life has been unfair or unreasonable may have grounds for initiating a grievance. Read Policy 70, Student Petitions and Grievances, Section 4. When in doubt, please be certain to contact the department's administrative assistant who will provide further assistance.

Discipline

A student is expected to know what constitutes academic integrity to avoid committing an academic offense, and to take responsibility for his/her actions. Check the Office of Academic Integrity for more information.

A student who is unsure whether an action constitutes an offense, or who needs help in learning how to avoid offenses (e.g., plagiarism, cheating) or about "rules" for group work/collaboration should seek guidance from the course instructor, academic advisor, or the undergraduate associate dean.

For information on categories of offenses and types of penalties, students should refer to Policy 71, Student Discipline. For typical penalties, check Guidelines for the Assessment of Penalties.

Appeals

A decision made or penalty imposed under Policy 70, Student Petitions and Grievances (other than a petition) or Policy 71, Student Discipline may be appealed if there is a ground. A student who believes he/she has a ground for an appeal should refer to Policy 72, Student Appeals.

Automatic system to detect plagiarism

Moss (Measure Of Software Similarity) or Turnitin may be used to screen each project in this course. Students' submissions are stored on a U.S. server, therefore students will be given an alternative if they are concerned about their privacy and/or security. It is the responsibility of the student to notify the instructor in the first week of the term if they wish to submit an alternative assignment. Students will be given due notice about arrangements and alternatives for the use of Moss or Turnitin in this course.