Skip to content

Instantly share code, notes, and snippets.

View Mohtashim-Syyed's full-sized avatar

Syed Muhammad Mohtashim Kamal Mohtashim-Syyed

View GitHub Profile
@Mohtashim-Syyed
Mohtashim-Syyed / producer_consumer.c
Created May 3, 2020 14:32 — 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