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

  Write a short structured design-using pseudocode

Write a short, structured design-using pseudocode only-that accomplishes this task.

  Advising about a software purchase

Your local art museum recently purchased a quad-core computer with 16 GB of RAM. The curator read an article about an art collection inventory system software package that could go on the new computer. You have a long experience with end users has..

  Create a class name gasprices

Purpose: Create a class name GasPrices. Its main() method holds an integer variable named pricePerBarrel to which you will assign a value entered by a user at the keyboard. Create a method to which you pass pricePerBarrel. The method displays the ran..

  Using sequential logic, counters and shift registers propose

using sequential logic, counters and shift registers propose a more complex system utilizing some of the more complex sub systems. example a motion acitavated light. Needs to be somthing other then a light example like motors or somthing

  What is the downward closure property

How does it aid in developing an efficient algorithm for finding association rules, that is, with regard to finding large item sets?

  Explain main resources in management information systems

The three main resources in management information systems (MIS) are information, information technology, and people. Which of these three resources is the most significant?

  Need help with writing prototype functions

Need help with writing prototype functions: For this assignment, you must write pseudocode and C code for several sub-functions that use pointers and arrays, and a main() function that calls your sub-functions, printing the specified values

  Harnessing information management

In Assignment 1, you investigated data analytics and the utilization of data analytics in business. In this assignment, use the company or industry that you selected in Assignment 1. Use the Internet or Strayer Library to explore the relationship ..

  What is responsibility of the dispatcher during a context

What is the responsibility of the dispatcher during a context-switch? There are two levels of scheduling. One level of scheduling determines which jobs will be admitted to the system and in what order. What does the other level of scheduling do?

  List and support three best practices in staffing

Having staff with the proper skill sets is immensely important to accomplishing corporate objectives. List and support three best practices in staffing future organizational needs.

  Computers using some ai techniques

Tablets Take Their Place in the PC Market on page 187 in the text and answer the questions below. APA formatting guidelines require a title page, abstract page, and reference page in addition to the body of the paper

  Review about influence of internet on our daily life

We live in a world where the internet plays a pinnacle role in our day to day lives. Discuss how the internet has caused an ethical debate on our information privacy.

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