Skip to content

cs 242 final project. exploring concurrency constructs across Go, Rust, and C via implementations of producer-consumer.

Notifications You must be signed in to change notification settings

gabbifish/producer-consumer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS 242 Final Project

Comparing Producer-Consumer Implementations in Go, Rust, and C

Authors

  • Gabbi Fisher
  • Christopher Yeh

Stanford CS 242: Programming Languages

  • Instructor: Will Crichton
  • Autumn, 2017-18

Getting Started

We assume this is running on macOS or Linux, and that gcc is already installed.

  • Install Rust (v1.20.0) - link
  • Install Go (v1.9.2) - link
  • Install libmill (v1.18) - link

To run the benchmark: bash ./bench.sh

Running individual implementations

All of the executables support the following flags:

  • -h: print the help menu and exit
  • -b BUF_SIZE: buffer size in number of integers (default=100)
  • -p NUM_PRODUCERS: number of producer threads (default=5)
  • -c NUM_CONSUMERS: number of consumer threads (default=5)
  • -e ELEMS_PER_PRODUCER: number of elements each producer adds to buffer (default=100)
  • -i: have producer threads sleep for 1ms before adding int to buffer
  • -j: have consumer threads sleep for 1ms after reading int from buffer

Other

NOTE: the C-protothreads implementation is experimental and not completely functional yet.

About

cs 242 final project. exploring concurrency constructs across Go, Rust, and C via implementations of producer-consumer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published