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

  Binary scientific notation

For IEEE 754 single precision floating point, what is the number, as written in binary scientific notation, whose hexadecimal representation is: 0061 0000

  Describe kinds of pc applications skills

Describe in scholarly detail the kinds of PC applications skills which important for working within a major organization? Also put yourself in the shoes of a manager and share your thoughts.

  Tools or tactics used by risk assessment team

In your new position at XYZ Corporation, you have been asked to lead risk assessment team. How can you bring everyone to agreement an what are there any tools or tactics you might use to help?

  Stage of ec purchase decision-making process

Banner advertising on Websites helps trigger a realization taht there is a gap between reality and a desired state, which occurs in the ______ stage of the EC purchase decision-making process.

  Consider a memory system with a level

Consider a memory system with a level 1 cache of 32 KB and DRAM of 512 MB with the processor operating at 1 GHz. The latency to L1 cache is one cycle and the latency to DRAM is 100 cycles.

  Find the approximate value of above functions

Derive taylor's polynomials of degree n for: f(x) = (1+x)^(1/2) and f(x) = cos x. Find the approximate value of above functions at x = pi/4 by hand calculator upto two decimal points. Show steps.

  Variety of tools that use to prepare project

In this course, you looked at a variety of tools that you would use to prepare a project. Some areas you looked at included, but were not limited to?

  Which vulnerability be evaluated for extra controls first

If organization has three information assets to evaluate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first? Which one must be evaluated last?

  Explain program manager for human services program

Write down 200- to 300-word email to friend describing new position and its responsibilities, incorporating all vocabulary words.

  Creating presentation to law school class on digital crime

You have been asked to present a presentation to law school class on digital crime. After presentation, a student asks why so few people are really prosecuted for computer crime.

  Odd-length cycle in directed graph by linear-time algorithm

Give a linear-time algorithm to find an odd-length cycle in a directed graph. You may NOT assume that the graph is strongly connected.

  Use a traditional for loop to process the array

Write a Java method which takes an integer array parameter and fills the array with random numbers between 1 and 1000, including 1 and 1000. Use a traditional for loop to process the array.

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