2dbi
Home/HP Inc/Producer-Consumer With pthreads
HHP Inc·DSASDE-2Onsite – Coding 1

Producer-Consumer With pthreads

Problem

Implement a bounded buffer shared by producer and consumer threads using mutex + condition variables (HP probes pthreads).

Example

Buffer size N; no busy-wait; no race

Constraints

  • Multiple producers/consumers

What HP looks for

Correct synchronization, no deadlock, and reasoning about condition variables.

added 6 days ago
LeadersAccount