GithubHelp home page GithubHelp logo

gabbifish / producer-consumer Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 271 KB

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

Go 7.33% Makefile 2.96% C 68.56% Rust 15.25% Shell 5.91%

producer-consumer's Introduction

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.

producer-consumer's People

Contributors

chrisyeh96 avatar gabbifish avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.