mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
27 lines
445 B
Markdown
27 lines
445 B
Markdown
---
|
|
title: "20-sync-deadlock"
|
|
aliases:
|
|
tags:
|
|
- cosc204
|
|
- lecture
|
|
---
|
|
|
|
# Bounded buffer problem
|
|

|
|
|
|
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" |