Write a multithreaded program

Assignment Help Basic Computer Science
Reference no: EM13219944

Write a multithreaded program (using pthread in Linux) that calculates various statistics values for a list of numbers. This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, and the third will determine the minimum value. The variables representing the average, minimum, and maximum values will be stored globally. The worker threads will set these values, and the parent thread will output the values one the workers have exited. Make sure it is able to compile a program prog.c with pthread, do "gcc -lpthread -o prog prog.c" Need the: a) The code b) Screenshot of the terminal showing your program running with at least 8 (different) numbers as run-time input.

Reference no: EM13219944

Questions Cloud

Compare the political scientists view of government : Compare the political scientist's view of government and economic policymaking and the Public Choice conception of politicians, bureaucrats and special interest groups in the political process. Which do you consider to be more realistic for unders..
Explain one mole of a monatomic ideal has at a temp : One mole of a monatomic ideal has at a temp of 500K and 6atm pressure is subjected to the following changes: (all are reversible changes)
Describe emerging technologies and trends : What technologies do you see becoming mainstream in the next 18 months, 5 and 10 years.
How much us gave for environmental clean-up of water system : If the United States gave Pakistan $1 billion for environmental clean-up of its water system, but a large portion of the money was diverted to be used for purchasing weapons,what would this be an example of in economic terms
Write a multithreaded program : Make sure it is able to compile a program prog.c with pthread, do "gcc -lpthread -o prog prog.c" Need the: a) The code b) Screenshot of the terminal showing your program running with at least 8 (different) numbers as run-time input.
How many should you order for the current review period : How many should you order for the current review period and if management decide to change the service level to 99% (which means 99% probability of not stocking out), how many should you order?
Write a fragment of code : Write a fragment of code that will read words from the keyboard until the word done is entered. For each word except done, report whether its first character is equal to its last character. For the required loop, usea a.While statment b. do-while ..
What would be the effects on the business resources : which phase of the SDLC do you think is the most important phase to this business, and why? What would happen if the organization didn't do a good job in that phase? What would be the effects on the business resources of time, money, and people?
Explain the equivalent temperature on the celsius scale : What would be the most likely formula for a compound composed of Ca and N? The boiling point of oxygen is 55°K. What is the equivalent temperature on the Celsius scale?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Creating a payoff table for decision

Amy decided to select the best option which will minimize her total 36-month cost. Difficult is that Amy is not sure how many miles she will drive over next three years. Create payoff table for Amy's decision.

  The basic solutions of the simplex method.

Solve the following problem by inspection, and justify the method of solution in terms of the basic solutions of the simplex method.

  Explores the performance consequences

This problem explores the performance consequences of having only a single level of cache in a modern processor with 40 ns DRAM column access time and a clock period of 400 ps (clock frequency 2.5 GHz). You are given the following data: A particul..

  Recursive multiplication

Recursive Multiplication Write a main program that uses a recursive function. This function accepts two arguments into the parameters x and y.

  Buy special equipment to prepare high-quality publications

buy special equipment to prepare high-quality publications itself or lease the equipment from another company. Suppose that leasing the equipment costs $240 per day. If you decide to purchase the equipment, the initial investment is 6,800, and operat..

  Create flowchart and psuedo code for math program

Create flowchart and psuedo code for math program which permits the user to enter two separate numbers and choose one of four mathematical operations (add, subtract, mutiply, divide).

  Calculate interest earned in one year

Calculate the interest earned in 1 year given starting account balance B and annual interest rate I and supposing simple interst, that is no compounding.

  Class polygon which draws a hexagon for a set of numbers

Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).

  Explain reasons for consulting different kinds of sources

Explain reasons for consulting different kinds of sources on the same subject.

  Analyze faster processor chip result increase in performance

Analyze the following statement: "Using the faster processor chip results in corresponding increase in performance of a computer even if main memory speed remains same."

  Use huffman coding for compression-decompression.

Use Huffman coding for compression/decompression. When computing the Huffman tree, do not compute the code for any character that does not exist in the input. Do not insert these characters into the min-heap.

  How versatility-microsoft excel affect application support

How does this versatility of Microsoft Excel affect application support? With this versatility and possible customization what assumptions must be made

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd