Skip to content

Instantly share code, notes, and snippets.

@crypto0007
crypto0007 / producer_consumer.c
Created November 25, 2019 13:09 — forked from navin-mohan/producer_consumer.c
Producer-Consumer problem in C using semaphores
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
/*
use the pthread flag with gcc to compile this code