Question: ITSE 2 3 1 7 JAVA PROGRAMMING ( INTERMEDIATE ) Program 7 Concurrency, Parallelism, and Multithreading Use the following classes, SimpleArray ( synchronized version )

ITSE 2317 JAVA PROGRAMMING (INTERMEDIATE) Program 7 Concurrency, Parallelism, and Multithreading Use the following classes, SimpleArray (synchronized version), ArrayWriter, and SharedArrayTest for this program. Rename the SharedArrayTest class as Program7. Change the array size to 15,000,000. Modify the run method to enter only the integers 1 to 10 for the elements of the array. The contents of the array should look like this: 1,2,3,4...10,1,2,3,4...10 and so on. Add a totalArray attribute to the SimpleArray class to return the sum of the elements in the array. Remove all the Thread.sleep statements in the methods of the classes mentioned above. Also, remove all the print statements in the SimpleArray class. Write a non-static method in the Program7 class named multiThreadedArray that uses a Fix Thread Pool the size of the number of CPU cores in the system and the classes named above to populate the array and find and display the sum of its elements. Do not display the elements of the array. Make sure your multithreaded code is thread safe and does not populate the array past the end. Display the CPU cores of the system after the developers information. Write a non-static method in the Program7 class named singleThreadedArray that creates a simple integer array of size 15,000,000, populates the array with the same integers as described for the multi-threaded version, and returns the sum of the elements. Do not display the elements of the array. Write a non-static method in the Program7 class named compareTimes. Use the Date/Time API timing techniques described in Section 23.12 to compare the time required for both modules (the Multi-Threaded and the Single-Threaded) to run. All classes in this program must be public, non-static and not nested in other classes and handle all exceptions where necessary. No input, processing or output should happen in the main method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!