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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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