Skip to content

Hugo2121/Bounded-Buffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bounded-Buffer README

  1. Bounded buffer implementation in C
  2. Uses Semaphore library - more information can be found at http://pubs.opengroup.org/onlinepubs/7908799/xsh/semaphore.h.html

Overview

implement producer-consumer algorithm to manage access to a bounded buffer to store candy. One group of threads will model candy factories which generate candy one at a time and insert the candy into the bounded buffer. Another group of threads will model kids which eat candy one a time from the bounded buffer.

How to run

./candykids <#factories> <#kids> <#seconds>

For example, ./candykids 3 1 10

  • Factories: Number of candy-factory threads to spawn.
  • Kids: Number of kid threads to spawn.
  • Seconds: Number of seconds to allow the factory threads to run for.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.6%
  • Makefile 4.0%
  • C++ 3.4%