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

  Input function to prompt the user to enter a square

In the script file, use the input function to prompt the user to enter a square 2-dimensional array. Use a loop to check that user's input is a square array and repeatedly ask the user to enter a square array until they enter a square array (you m..

  Explaining publication of material in foreign languages

Which of the given statements about publication of material in foreign languages is not right? it is competitive neccessity or it must be accurate.

  Calculate the minimal sum logic for each output

How would I do this problem? When it says 4-bit two's complement numbers, what does it mean?

  Explain performance measures for balanced scorecard system

Explain three specific performance measures which could be utilized in Balanced Scorecard system in industry of your choice.

  Customer from the first part of this discussion

Suppose that you learn that the customer from the first part of this discussion is unsure as to whether the database is going to run only during normal business hours or whether it needs to run 24 hours / 7 days a week. Assess the importance of kn..

  Display the total and average number of calories burned

How would you solve the following in C++? Please write code below: Write a condition-controlled while loop that allows the user to enter the calories they burned. Stop looping when the user enters a negative number. Display the Total and Average n..

  Describe why suggestion of connecting by twisted pair cable

Describe why you would suggest connecting all current and new client computers using twisted pair cable instead of staying with the current coax wiring structure.

  Reason for problem encounter in deleting path variables

Discuss some of the problems he may soon encounter and explain the reasons for these problems. How could he easily return path to its original value?

  Designing a 24 cpu multiprocessor chip

designing a 24 CPU multiprocessor chip to compete with Intel PHI at a lower price point. Each core will run at 2 GHz and have a 32Kb L1 cache, 50ps access (per word), 8 word blocks, 4-way associative, write-through, 1% miss ratio There is a 6Mb L2 ca..

  Write a complete program in a class named showdesign

Write a complete program in a class named ShowDesign that uses the DrawingPanel The window is 200 pixels wide and 200 pixels tall. The background is white and the foreground is black.

  Determine one-s complement of sum of eight-bit bytes

UDP and TCP use 1s complement for their checksums. Assume you have following three 8-bit bytes: 01010101, 01110000, 01001100. Determine the 1s complement of sum of these 8-bit bytes?

  Formulate the lp model for union city to minimize

Relevant information on the six potential locations of the warning siren towers and distance in miles to each of the seven schools is presented in the table below. Formulate the LP model for Union City to minimize towers built.

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