Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ALERT: ONLY LINUX EXPERT WITH C++ KNOWLEDGE.PLEASE TAKE YOUR TIME WRITE COMPLETE PROGRAM Write a C program that should run on Linux platform using gcc

ALERT: ONLY LINUX EXPERT WITH C++ KNOWLEDGE.PLEASE TAKE YOUR TIME WRITE COMPLETE PROGRAM

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. Dont 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

Output:

image text in transcribed

NOTE:

I am posting above question 4th time on this platforms but sorry to say that all experts who replied previously have given same code with copy and paste and this code does nothing with my question and does not give me required output solution, if any one have exact code which can solve above program with steps should post here. i think it would not be a complex program as given by other experts. plz see below code

Enter the D ta 1 umber of thread, 1 D 50) : 10 Enter rrival Time of thread1 Enter CPU Time Df thread A: Enter Arrival Time Df thread : 2 Enter CPU Time Df thread : 8 Enter rrival Time of thread C: 3 Enter CPU Time of thread C: 2 Enter >rrival Time of thread 4 Enter CPU Time of thread 1 Enter >rrival Time of thread E 5 Enter CPD Time of thread E: 4 nter Arrival Time of thread F: 6 Enter CPD Time of thread F: 5 Enter arrival Time Df thread G: Enter CPU Time of thread : 1 Enter rrival Time of thread H: 8 Enter CPU Time Df thread B: nter Arrival Time of thread I: 9 nter CPU Time of thread 8 Enter rrival Time of thread 10 Enter CPU Time of thread 2 lime Interval Arrival Threads Horking Thread- ?inish Thread: A, 10 1l F, R 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

2. Do you exercise? yes no

Answered: 1 week ago