Write a multithreaded program in c under the linux operating

Assignment Help Computer Engineering
Reference no: EM132206705

Write a multithreaded program in C under the Linux operating system using the pthread API.

The program shall accept a data filename from the command line, containing the number n, and n distinct integers, one value per line.

The program shall use the above algorithm to find their maximum as described above.

Your program shall read as much values as defined by the first integer n, or until the end of the data file is reached if the number of entries is less than n.

The program shall then write the first 2 output lines, then create n threads for Step 1, then wait for all threads to finish, then write the contents of array W, then create n*(n-1)/2 threads for Step 2, then wait for all threads to finish, then write the contents of array W again, then create n threads for step 3, then wait for them to finish, then print the result and exit.

Your program shall check for all possible errors, and if there are some errors, it shall attempt to correct them by interacting with the user or terminate gracefully after printing a useful error message.

Reference no: EM132206705

Questions Cloud

Organizations should look within their organization : Organizations should look within their organization for available talent when opening exists, if there are suitable candidates.
Write a main function that inputs three points from the user : The Triangle class should have one default constructor and another constructor that initialises the three points of the triangle.
Why does much fdi occur in such industries : Why does much FDI occur in such industries as pharmaceuticals and electronic products, while little FDI occurs in such industries as clothing and paper products
Most important for leaders in cross-cultural organizations : Which attribute is considered most important for leaders in cross-cultural organizations?
Write a multithreaded program in c under the linux operating : Your program shall read as much values as defined by the first integer n, or until the end of the data file is reached if the number of entries is less than n.
Describing the homogeneity properties of the functions : Show that the result in part(a)implies that individuals will allocate their funds equally between x and y for the Cobb-Douglas case(8=0), as we have shown.
What the project hopes to accomplish : Your project has been staffed and you are about to meet with the team for the first time. What the project hopes to accomplish.
Determine the height of the triangle : Write a nested loop to create a triangle that utilizes a random number between 1 and 5 to determine the height of the triangle.
What is the relationship between intelligence and leadership : What is intelligence? What is the relationship between intelligence and leadership?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Algorithm for finding two closest numbers in the input list

plan an algorithm for finding two closest numbers in the input list. What is the time complexity? Is it possible to improve the algorithm if the input is a sorted list.

  Write finite-length pulse in terms of unit-step signal

Make a plot of the signal u(4 - t). Determine the region where the signal u(4 - t) is zero.

  Write a call and return sequence for an src procedure

Procedure-calling sequences are standard groups of instructions. Write a call and return sequence for an SRC procedure with two input and one output arguments.

  Build an application that produces non-personalized greeting

Build an application that produces a simple non-personalized greeting to the user. The application must count the number of times it is run.

  Display the results of the df -h command on reboot

Suppose you had a program that stored log files in the directory /var/log/impProgram and you were worried about the disk running out of room.

  Relational database with microsoft access

Relational Database with Microsoft Access 2010.

  Program demonstrates simple symmetric-key encryption

This program demonstrates simple Symmetric-key Encryption using the XOR instruction with a multi-byte key entered by the user. Use this key to encrypt and decrypt the plain text

  How does ecommerce trend combine hardware

Describe each component What kind of people/companies might make use of this trend?

  What do you suggest that brian tell joe

Because Brian has a little inside knowledge about Joe's agenda for this meeting, he has been considering how to handle Joe. What do you suggest that Brian tell Joe?

  Test your function with three different integer arrays

Write a function, named avg, that receives an array of integer values and returns the average of those values in that array.

  What addressing mode is most appropriate

Suppose n will be the result of an addition instruction and, thus, is not known statically. What addressing mode is most appropriate to use to access the data located in memory at an address that is n bytes larger than the contents of register X?

  What is the complexity of the switch architecture

What is the complexity of the switch architecture?Use T-S-T hybrid switch to replace the Clos space domain switch designed in part a.

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