Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91790290

Have any Question?


Related Questions in Computer Engineering

What is the fraction defective if material hardness is

What is the fraction defective if material hardness is normally distributed with a mean of 42 and a standard deviation of 1 and the specification limits for hardness are from 35 to 45? What value for the process mean wil ...

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

In what kind of economy is a central planning board or

In what kind of economy is a central planning board or commission typically used to answer the basic economic questions?

Question cyber attacks on critical infrastructures-a risk

Question: Cyber Attacks On Critical Infrastructures-A Risk To The Nation There has been a great deal of research related to cyber attacks and vulnerabilities and critical infrastructure, but there is an incomplete unders ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

Segmentationassume virtual memory hardware that uses

SEGMENTATION Assume virtual memory hardware that uses segmentation, and divides the address space in two by using the top bit of the virtual address. Each segment is thus relocated independently. What we'll be drawing in ...

Calculate the energy of one photon of blue light that has a

Calculate the energy of one photon of blue light that has a wavelenght of 425 nm and red light that has a wavelenght of 740 nm. Use E = hv and C = frequency x wavelenght(v). And determine which photon has highest energy.

Rocket class keyboard event handlingintroductionfor this

Rocket Class: Keyboard Event Handling Introduction For this program, you will implement an interface that will allow you to move around a rocket of your own design. You will need to implement your own classes for the roc ...

Calculate the standard gibbs free energy change and the

Calculate the standard Gibbs free energy change and the equilibrium constant for the oxidation of a formate ion to carbon dioxide at pH=7 and room temperature.

How does the learning environment effect the success of

How does the learning environment effect the success of students? Provide examples.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As