Create each thread as its arrival time comes

Assignment Help Basic Computer Science
Reference no: EM131065907

Write a C program that should run on Linux platform using gcc compiler. You are required to simulate threads creation and termination behavior by using POSIX threads library.

Input:

In the main program, first take the value for total number of threads and then ask user to provide the arrival time and CPU time (i.e. running time) for each thread.

Output:

Simulate the behavior of threads arrival, working and termination at a specific time interval (i.e. 500ms).

Requirements:

i. Name the program threadsimulator.c

ii. Create each thread as its arrival time comes, keep it in working state and terminate as the CPU time finishes.

iii. All creation and termination of threads must be done by using POSIX threads library.

iv. During the process, keep record of all non-terminated threads and show them in working state continuously.

v. The time duration between two intervals must be 500ms.

vi. Provide the commands to compile and run the program.

vii. Submit the program as a separate file. Don't embed the code in the assignment solution word file.

viii. Follow the sample interface and output for the program which is shown subsequently.

A sample interface and output for the program is shown as follows. Here to keep it short, only ten threads are taken. Your program should work for 1, 2, 3, 4, ..., up to 50 threads. The input from user is shown in bold.

Reference no: EM131065907

Questions Cloud

Explain the specific function of each of the components : The steps of how customer order information is collected and moved to the internal database. By "steps," give the machines the data visits and the function of the machine.
Shortly after reading the article greg received : Shortly after reading the article Greg received a call from one of his Japanese suppliers, a provider of the wheel assemblies for the skateboards (both the standard model and longboard). Greg has been purchasing the wheel aseemblies from the suppl..
Respond to the given post : Respond to each peer initial posting with 3-4 sentences long.
Difference between a public good and a private good : What is the difference between a public good and a private good? What are the principal characteristics of each? What are the two characteristics of public goods? Why is there a free rider problem when it comes to public goods?
Create each thread as its arrival time comes : Create each thread as its arrival time comes, keep it in working state and terminate as the CPU time finishes.
Calculate the equilibrium level of income or real gdp : Calculate the equilibrium level of income or real GDP for this economy. What happens to equilibrium Y if Ig changes to 15? What does this outcome reveal about the size of the multiplier?
Availability of products expected to change : Compare a $30,000 income in 1975 to that in 2015, and analyze the following questions: How is the availability of products expected to change over the years?
A wholesale distribytor of eletronic components : Whaley Distributors is a wholesale distribytor of eletronic components. Financial statements for the year ended December 31, 2014 and 2015, reported the following amounts and subtotales ($ in millons):
Write a project lab report about the given structure : Write a project lab report about the given structure. I need some one to write a final project lab report. In the attachment you will find the experiments we have done in this class, also you will find photos of the final product that we have done.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Methods differ from their instance counterparts

Explain how class (static) variables and methods differ from their instance counterparts. Give an example of a class that contains at least one class variable and at least one class method.

  Generalized statements relating to a group of people

Identify the rhetorical strategy in each of the following statements. 1. I did not say the meat was tough. I said I did not see the horse that is usually outside (W. C. Fields). _________________ 2. Have you stopped beating your wife? ____..

  Compare the different types of interactive environments

Compare and contrast the different types of interactive environments

  Management document to provide a comprehensive idea

The above documents should clearly be developed using a project tool that is available to you. You should make necessary assumptions in deciding your basis that would yield to the above documents. You are required to state your assumptions clearly..

  Describe the windows xp operating system

Describe the Windows XP operating system. Discuss some of your favorite XP features, including its security, management, and administrative features. How do these compare with similar functionalities of other operating systems that you've used

  Describe the roles of a data administrator (da)

You also want to take this opportunity to answer any potential questions about personnel needs with this new database environment. Describe the roles of a data administrator (DA) and a database administrator (DBA); describe the job functions of ea..

  What happens to time out

After a packet is eventually received, we resume with Time Out initialized to the last exponentially backed-off value used for the timeout interval.

  Design a tick tac toe game

Design a Tick Tac Toe Game. You must use Arrays to represent the board You may use Pointers

  Convert the message into ascii (use hex notation)

Convert the following message into ASCII (use Hex notation) Easy as 1.2.3!

  What might be some of the inhibitors on organizations

What might be some of the inhibitors on organizations or institutions who newly desire a global presence? Why is that management, a relatively small percentage of the work force, has become the prime user of information technology, as opposed to the ..

  Convert 6bd3h into its binary and decimal equivalent

Convert 6BD3H into its Binary and Decimal equivalent

  Buying decisions major element in determining

Buying decisions are a major element in determining how to satisfy customers' needs more effectively than the competition. With this in mind, prepare a report for the Senior Buyer of JD Sports which

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