/Candy-Kids

Utilized producer-consumer solution to manage access to a bounded buffer storing data items

Primary LanguageC

Candy Kids

Utilized producer-consumer solution to manage access to a bounded buffer storing data items

Course

2018 Spring, SFU
CMPT 300: Operating Systems I

Author

James(Yuhao) He

Platform

Linux & Windows

Building tools

Standard C

License

This project is under C License

Overview

Inputs

The program will accept three arguments:
./candykids <# of factories> <# of kids> <# of seconds>

# of factories: Number of factory threads to spawn
# of kids: Number of kids threads to spawn
# of seconds: The number of seconds to allow the factory threads to run for

Outputs

Display a statistics module tracking:

Count the number of candies each factory has produced
Count the number fo candies that were consumed from each factory
For each factory, the min, max, and average delays for how long it took from the moment the candy was produced (dynamically allocated) until consumed (eaten by the kid).

Sample stats summary

screen shot 2018-05-01 at 9 51 46 pm