Course Calendar


Last updated: 1/12/21

  • Lecture videos are posted on Canvas under the "Course Videos" tab.
  • Live Zoom session links are posted on Canvas under the "Zoom" tab.
  • Lecture check-in quizzes are posted on Canvas under the "Assignments" tab and are due at the beginning of each live lecture unless otherwise noted.

Any code examples worked in class will be posted after lecture into /afs/ir/class/cs110/lecture-examples, in a subfolder based on topic. You can make a copy to compile or modify and continually pull in any updates to these lecture examples throughout the quarter by doing the following:

git clone /afs/ir/class/cs110/lecture-examples

You only need to do this once to make your own copy of lecture-examples wherever you'd like. From then on, if you need to pull in updated examples (e.g. for the next topic), within that folder execute git pull to pull in the latest changes.

You can also view lecture code from your web browser by clicking here.

Week Monday Wednesday Friday (or Lab Th/Fr)
1 January 11
1. Welcome to CS110 / Intro to Filesystems
notepad:smallAssignment 1 released, due 1/20
presentation:smallSlides, [PDF]
document:smallHandout: CS110 Course Outline
book_1:small Reading: Skim S & K Chapter 2

Introductions, course administration and expectations. We will introduce Unix file systesms today, as well.
January 13
2. File Systems, APIs, and System Calls
presentation:small Slides, [PDF]
code:small Code (lambdas)
code:small Code (file systems)

We need to invest some time learning about some C and some UNIX/Linux libraries that offer us programmatic access to the file system. There are a few data structures and a collection of Linux library functions that allow us to crawl over the tree of files and directories, and there are even more functions that grant us raw, low-level access to the file contents. We'll invest some time discussing these functions and data structures—enough that we can implement a collection of obvious and not-so-obvious programs that emulate some of the terminal/shell builtins you've been using your entire UNIX lives.
January 15
3. (Lecture) More on Filesystems APIs
presentation:small Slides, [PDF]
book_1:small Reading: S & K Chapter 2

We'll work through a few more UNIX Filesystem API examples before advancing on to a discussion of how the raw hardware of a disk is leveraged to look like the filesystem you've taken for granted for the entirety of your UNIX and programming careers. Our hope is that by the end of the day you'll have gained a familiarity with the filesystem APIs and begin to understand how filesystems work under the hood.
2 January 18
No class -- Martin Luther King, Jr., Day
January 20
4. Filesystems Data Structures and System Calls
presentation:small Slides, [PDF]
book_1:small Reading: Begin Bryant & O'Hallaron, Chapters 2 and 1 (in that order). Chapters 2 and 1 correspond to Chapters 10 and 8 of the full textbook.
code:small Filesystems Code
code:small Processes Code
notepad:smallAssignment 2 released, due 1/28


We need to work through the rest of our discussion of how a filesystem is layered over raw hardware. We started to explain how basic files—be they text files, audio files, executable images, etc— are segmented into blocked and distributed across free sectors of the hardware. We need to advance that discussion to be clear how filesystem supplorts the notion of a directory, and how an absolute path name like /usr/class/cs110/WWW/index.html can be parsed and translated to an inode number, which is the location within the inode table that stores metainformation about that file and where all of its payload blocks live.

We'll then discuss a few things as a way of transitioning to multiprocessing: how open file sessions are maintained by the OS on a per-process basis, and how system calls differ from traditional function calls. And time permitting, we'll introduce a new system call that's used to spawn new processes.

January 21/22
Lab / Discussion 01. File System Experimentation
notepad:small Lab 01: File Systems and System Calls | (solution)


Your first lab will have you discuss the various ways you can exploit a file system design to implement other functions. You'll also get a chance to play with the stat command line utility and learn some new valgrind tricks.

3 January 25
5. Understanding execvp
presentation:small Slides, [PDF]
book_1:small Reading: Begin: Bryant & O'Hallaron, Chapters 2 and 1 (in that order). Chapters 2 and 1 correspond to Chapters 10 and 8 of the full textbook.
code:small Code

Last time we introduced fork in the final minutes of lecture. Today we need to work through a collection of etudes so that we master the nuances of how fork works. We'll then introduce related functions, waitpid and execvp, which are used to synchronize multiple processes and transform processes to run a new executable instead of the one it inherited as part of the fork call.
January 27
6. execvp, Interprocess Communication and pipes
presentation:small Slides, [PDF]
book_1:small Reading: Continue Reading: Bryant & O'Hallaron, Chapters 2 and 1 (in that order). Chapters 2 and 1 correspond to Chapters 10 and 8 of the full textbook.
code:small Code

Last time, we introduced execvp as the one system call that reboots a process to execute the main function of a new executable. We need to advance that discussion today by working through the implementation of a tiny shell, much like the one you're using whenever you'll using Unix. We'll then introduce the notion of a pipe as a way to set up communication channels between multiple processes.
January 28/29
Lab / Discussion 02: Multiprocessing Experimentation
notepad:smallLab 02: Multiprocessing Experimentation
notepad:small(Fri) Assessment 1 released, due 2/1

This week we'll investigate the use of fork, execvp, and waitpid to build a command line utility called exargs. We'll then blend in some file descriptor and multiprocessing work to better understand how the two work together, and time permitting, we'll work through some short answer questions to prompt you to think more holistically about how fork and multiprocessing work.

The lab handout includes a collection of laptop exercises to elevate your gdb and valgrind acumen, though the CA who leads your discussion section may opt to focus on the whiteboard problems and leave the laptop experimentation to you.

4 February 1
7. Signals, Signal Handlers, and Signal Blocks
presentation:small Slides, [PDF]
book_1:small Reading: Begin: Bryant & O'Hallaron, Chapters 2 and 1 (in that order). Chapters 2 and 1 correspond to Chapters 10 and 8 of the full textbook.
notepad:smallAssignment 3 released, due 2/12


We need to discuss signal masks, signal blocking, and how they can be used properly to avoid concurrency issues. We'll start with a contrived example where code is technically capable of executing in an order we don't intend, and we'll use signal masks and blocking to fix the problem. We'll then advance to work through a series of improvements to the simplesh program that we wrote last time.

February 3
8. Race Conditions and Deadlock, and revisiting sigsuspend
presentation:small Slides, [PDF]
--> book_1:small Reading: Begin: Bryant & O'Hallaron, Chapters 2 and 1 (in that order). Chapters 2 and 1 correspond to Chapters 10 and 8 of the full textbook.

We will discuss some subtle yet interesting race conditions that can lead to a state called deadlock, where a process seemingly freezes. We will also talk about how to properly use signal handlers to clean up all children.
February 4/5
Lab / Discussion 03: Parallel Programming
notepad:smallLab 03: Parallel Processing


We'd like you to spend the section studying a parallel implementation of mergesort so you understand its architecture and ultimately believe that it works. Time permitting, we'd like you to work through a collection of short answer questions to solidify your understanding of virtual memory and process scheduling.

5 February 8
9. Introduction to Threads
presentation:small Slides, [PDF]
book_1:small Reading: Continue reading: Bryant & O'Hallaron, Chapters 4, skipping section 4.2. Chapter 4 refers to Chapter 12 of the full textbook.
code:small Code

We will spend some time explaining the various OS components that allow multiple processes to be (seemingly) running at the same time, even when there's just one CPU. We also want to discuss how each process can operate as if it owns all of memory, even though it clearly doesn't. We'll be discussing virtual memory and the process scheduler to advance our understanding of how these things might work.

We'll then move on to our discussion of mutlithreading and begin to work through the lecture examples We've provided today.

February 10
10. The Dining Philosopher Problem, condition variables, and semaphores
presentation:small Slides, [PDF]
--> book_1:small Reading: Continue reading: Bryant & O'Hallaron, Chapters 4, skipping section 4.2. Chapter 4 refers to Chapter 12 of the full textbook.
code:small Code
We are moving on to the dining philosophers simulation to illustrate how a system can arrive at deadlock and forever starve all threads of from CPU time. That'll be our opportunity to introduce the condition variable and the semaphore as a means of preventing deadlock from ever happening.
February 11/12
notepad:small(Sat) Assignment 4 released, due 2/22

No labs this week

6 February 15
No class -- Presidents' Day
February 17
11. Semaphores and Multithreading Patterns
presentation:small Slides, [PDF]
book_1:small Reading: Continue reading: Bryant & O'Hallaron, Chapters 4, skipping section 4.2. Chapter 4 refers to Chapter 12 of the full textbook.
code:small Code
February 18/19
Lab / Discussion 04: assign3 Redux, Threads
notepad:smallLab 04: assign3 Redux, Threads

notepad:small Lab 04 Solution


We'd like to spend this week's lab reviewing everything about Assignment 3 that made it challenging. By now, you're well aware how difficult multiprocessing and concurrency can be, and we want to take time to review some of the most important concepts. Problem 1 has you revisit those programs and work through why they needed to be written the way they were.

The remaining three questions all deal with multithreading. We think all three questions are instructive, but it's probably more important to work through problems 2 and 3. Problem 4 is a coding question, and that can be managed independently, outside of lab time.

7 February 22
Optional Extra Pre-recorded Videos: More About Systems
notepad:smallAssignment 5 released, due 3/5


Ryan Eberhardt, the CS110A CA, is posting some optional extra pre-recorded videos if you're interested in some additional material covering the CS110 systems topics. There's no live session, but feel free to post on Ed or stop by office hours if you want to chat about the material!

February 24
12. More Multithreading Examples - Ice Cream Store
presentation:small Slides, [PDF]
book_1:small Reading: Finish Reading: Bryant & O'Hallaron, Chapters 4, skipping section 4.2. Chapter 4 refers to Chapter 12 of the full textbook.

Today we will talk more about common multithreading patterns, including an in-depth ice cream store example.
code:small Code
February 25/26
Lab / Discussion 05: rwlocks and Event Barriers
notepad:small Lab 05: rwlocks and Event Barriers


We'll work through the implementation of a rwlock class, which is like a traditional mutex, except that it allows multiple threads to be in a critical region, provided none of them need to change any shared data structures.

Once we work through that, we'll move on to another threading construct, called an Event Barrier, for modeling lifting a barrier for threads to continue.

8 March 1
13. Introduction to Networking
presentation:small Slides, [PDF]
book_1:small Reading: Continue Reading: Bryant & O'Hallaron, Chapter 3 and Section 4.2. Chapter 3 of the reader corresponds to Chapter 11 of the full textbook.

After a bit of multithreading wrapup, we'll move on to formally introduce networking, the client-server idiom, request-response, and argue why a network connection is little more than a bidirectional pipe between processes on different machines.
March 3
14. API Servers
presentation:small Slides, [PDF]
book_1:small Reading: Continue Reading: Bryant & O'Hallaron, Chapter 3 and Section 4.2. Chapter 3 of the reader corresponds to Chapter 11 of the full textbook.

We are going to spend some time on to building an API server using threads and processes. We will then dig deeper into some network system calls.
March 4/5
notepad:small(Fri) Assessment 2 released, due 3/8
Lab / Discussion 06: Networking
notepad:smallLab 06: Networking


This week's lab will invest some time understanding more about networking. And then we'll work together to implement a collection of simple servers.

9 March 8
15. More on GET, HEAD, POST, and introduction to the Proxy assignment
notepad:smallAssignment 6 released, due 3/19
presentation:small Slides, [PDF]
March 10
No Lecture
March 11/12
Lab / Discussion 07: ThreadPool and Proxy
notepad:smallLab 07: ThreadPool and Proxy


We'll spend some time talking about aspects of the ThreadPool assignment and the Proxy assignment, specifically how things for the proxy could have been implemented differently.

This is the last week of section!

10 March 15
16. MapReduce / Principles of System Design
book_1:small Reading: Finish Reading: Bryant & O'Hallaron, Chapter 3 and Section 4.2. Chapter 3 of the reader corresponds to Chapter 11 of the full textbook.
presentation:small MapReduce Slides [PDF], Principles of System Design Slides [PDF]
Today we'll embark on a recap of all of the general systems design principles we've been exposed to over the course of the quarter and try to make it clear that a system's design is often more intellectually captivating than its implementation. We'll also provide a short overview of how MapReduce works. We do so because it's an easily described distributed system that relies on every major topic we've relied on this quarter, and it's a huge victory to fully understand how something like this can be implemented using everything you've learned in CS110.
March 17
17. Systems Today and Wrap-Up
March 18/19
No labs this week