Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i need to solve this two questions immediately 04 (20 points) A system with two dual-core processors has four processors a scheduling. A CPU-intensive application
i need to solve this two questions immediately
04 (20 points) A system with two dual-core processors has four processors a scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is performed just before the program terminates, when the program results must be written to a single file. Between startup and termination, the program is entirely CPU bound. Your task is to improve the performance of this application by multit threading model (each user thread maps to a kernel thread). ing it. The application runs on a system that uses the one-to-one a) (10 points) How many threads will you create to perform the input and output? Why? b) (10 points) How many threads will you create for the CrU-intensive portion of the application to achieve the most effective parallelism? Why? Q5 a) (15 points) - Write a multithreaded program (either in C or Java) that calculates various statistical values for a list of numbers. The program will be passed a series of numbers on the command line (the examples we covered during the last lecture illustrates how to handle command line arguments both n C and Java), and will then create three separate worker threads One thread will determine the average of the numbers, one will determine the maximum valuc, and one will determine the minimum value. For example, suppose your program is passed the integers 90 81 78 95 72 85 The main thread of your program should produce the output The average value is 82 The maximum value is 95 The minimum value is 72 The main thread should wait for all worker threads to finish their jobs and exit before generating the output as given above. b) (5 points) What type of parallelism is achieved with the execution of your program on the data given? Why
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started