Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Parallel version 1 (Name this file as Q1_PLV1.java): o Repeat the sequential version using two threads along with the main thread. o Each thread creates

Parallel version 1 (Name this file as Q1_PLV1.java):

o Repeat the sequential version using two threads along with the main thread. o Each thread creates a list of 25,000 students with randomly generated GPAs, randomly generated Ages, and sequential IDs. o Each of the two threads then calculates the average GPA and AGE (after creating the lists). o The two threads work in parallel. o The main thread waits for the two threads to finish and then calculates and prints the final average GPA and AGE from what

is reported by the individual threads. Parallel version 2 (Name this file as Q1_PLV2.java):

o Repeat the Parallel version1 task using five threads (each is working on 10000 students) along with the main thread. To measure the time your computer takes to complete a certain task:

Read and store the current time (t1) before you start the task (e.g., before creating the lists), After the task (e.g., after calculating the average), read and store the current time (t2). The time it takes your computer to complete the task is then: t2 t1.

I need correct code and output for both parts of this queation

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago

Question

=+j Explain IHRMs role in global HR research.

Answered: 1 week ago