Skip to content

Instantly share code, notes, and snippets.

View mjay4's full-sized avatar
🙂
Never Stop and Never Settle.

Mritunjay Choubey mjay4

🙂
Never Stop and Never Settle.
View GitHub Profile
@mjay4
mjay4 / producer_consumer.c
Created August 19, 2019 09:02 — 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