Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 1.08 KB

README.md

File metadata and controls

14 lines (11 loc) · 1.08 KB

Monitor Warehouse

This contains implementations of various monitors at various granularities to impress upon myself the lunacy of writing monitors by hand! Example monitors largely come from the expresso paper.

In the src directory, the following monitors are implemented with a monitor and a driver in the following directories:

  • rwlock/ holds standard read-write monitors which make sure readers don't enter during a write and writers don't enter during a read.
  • boundedbuffer/ holds a monitor which blocks threads wanting to write on a buffer until there is sufficient space and blocks threads trying to read n items from the buffer until there are n items on the buffer
  • sleepingbarber holds a monitor which
    • lets a barber wait until a customer wakes them up or one is in the waiting room, then cuts their hair
    • lets customers come into the shop, wake up the barber if necessary or take a spot in the waiting room if the barber is cutting hair (and there is a spot available, otherwise leave without a haircut)