quartz/content/notes/20-sync-deadlock.md
2022-10-30 14:25:53 +13:00

27 lines
445 B
Markdown

---
title: "20-sync-deadlock"
aliases:
tags:
- cosc204
- lecture
---
# Bounded buffer problem
![slide|400](https://i.imgur.com/tdAllKY.png)
producer consumer problem
issues
- no data in buffe: consumer has nothing to consume
- buffer is full: no space for producer to produce
private vars
- in: next pos in buf to be writted
- out: next pos in buf to be read
shared variables
- buffer
- counter: number of items in buffer
waiting
- busy"