C - circular character buffer w/ pthreads
- by Matt
I have a homework assignment where I have to implement a circular buffer and add and remove chars with separate threads:
#include <pthread.h>
#include <stdio.h>
#define QSIZE 10
pthread_cond_t full,/* count == QSIZE */
empty,/* count == 0 */
ready;
pthread_mutex_t m, n; /* implements critical section */ …