Skip to content

Beleebs/ConsumerProducerOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConsumerProducerOS

Consumer/Producer programs for Operating Systems @ Kent State University

Ben Leber
CS33211 - Operating Systems
Dr. Guan
March 28, 2025

This is the submission for project 1, the Consumer-Producer Problem. For this submission, I used sys/mman.h for shared memory access, so the program is only usable in a linux environment.

Compiling the Processes

There are two ways to go about compiling:

Makefile:

make clean
make

Manual

g++ consumer.cpp -pthread -lrt -o consumer
g++ producer.cpp -pthread -lrt -o producer

Running the Processes

To run the processes at the same time, use:

./producer & ./consumer &

Killing the Processes

Once the consumer is done, use CTRL + C to end the consumer program. The producer will still be running in the background, so in order to stop the process you need to use ps to list all processes running. Once you find "producer," use the PID from ps to run kill INSERT_PID.

Additionally, you can run make kill, to kill both processes at once.

About

Consumer/Producer programs for Operating Systems @ Kent State University

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published