Everyone:

Last week, we discussed how to utilize locks and condition variables to synchronize multiple threads and to construct concurrent data structures. Though tricky, we saw that there were some common programming patterns that allow us to implement monitor style mutual exclusion.

The readings this week focus on a new synchronization primitive called a semaphore and on concurrency bugs such as deadlock.

TL;DR

For this reading assignment, you are to read about semaphores and deadlock, and submit your responses to the Reading 06 Quiz.

Reading

The readings for this week are:

  1. Operating Systems: Three Easy Pieces

    1. Semaphores

    2. Concurrency Bugs

    3. Summary

Optional Resources

  1. Overview of POSIX Semaphores

  2. The Little Book of Semaphores

  3. The Dining Philosophers Problem With Ron Swanson

Quiz

Once you have done the readings, answer the following Reading 06 Quiz questions:

Submission

To submit you work, follow the same process outlined in Reading 00:

$ git checkout master                 # Make sure we are in master branch
$ git pull --rebase                   # Make sure we are up-to-date with GitLab

$ git checkout -b reading06           # Create reading06 branch and check it out

$ cd reading06                        # Go into reading06 folder
$ $EDITOR answers.json                # Edit your answers.json file

$ ../.scripts/submit.py               # Check reading06 quiz
Submitting reading06 assignment ...
Submitting reading06 quiz ...
     Q01 0.60
     Q02 0.30
     Q03 0.30
     Q04 0.10
     Q05 0.40
     Q06 0.80
     Q07 0.20
     Q08 0.30
   Score 3.00

$ git add answers.json                # Add answers.json to staging area
$ git commit -m "Reading 06: Done"    # Commit work

$ git push -u origin reading06        # Push branch to GitLab

Remember to create a merge request and assign the appropriate TA from the Reading 06 TA List.