Giter Club home page Giter Club logo

program2's Introduction

program2

posix threads

Programming Assignment #2 --- POSIX Threads and Signals

  1. Your task in this assignment will be to write a routine which creates threads, has them do work in parallel, and then terminates when the last thread has completed. The Setup: There are several students sitting near each other rooting for their favorite teams. Each student will cheer for his or her team some given number of times. The Program: Your task is to write a program which will simulate this cheering. The program should be called cheer.c, and should generate an executable called cheer. When the program is run from a command line prompt, arguments may be given to specify how many times. The main() routine then creates a thread for each team, and each thread is responsible for cheering a random number of times (range between 1:10) and for the correct number of teams team. A global counter of the number of cheers printed for each team will need to be kept.
    Have a read-only array of 10 possible teams eg. (“Bulldogs”,”Pirates”,”Tigers”,”Lions”,,…) A cheer for a particular team looks like this: "Go Pirates!" A sample run would look something like this with 4 threads: % cheer 4 Go Bulldogs! Go Bulldogs! Go Bulldogs! Go Bulldogs! Go Tigers! Go Lions! Go Lions! Go Pirates! Go Pirates! Go Pirates! 9 – Cheers! %

program2's People

Contributors

semantical-monster 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.