Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA PLEASE!!! :) Multithreading can help in achieving parallelism in computational problems. This makes the programs response to generate output faster. It is achieved

IN JAVA PLEASE!!! :)

Multithreading can help in achieving parallelism in computational problems. This makes the programs response to generate output faster. It is achieved by delegating independent tasks within the program to separate threads instead of creating a sequential routine. Consider the following sample double array: 3 11 5 19 1 8 4 16 7 18 17 6 3 23 9 If the problem is to display all the row-sums and all the column-sums, a sequential program would use loops. In that case, the second row (or, column) sum cannot be computed before completing the first row (or, column) sum. However, we can observe that calculating and displaying a particular row (or, column) sum does not depend on calculation and display of other row (or, column) sums. Hence, the inherent parallelism in the problem calls for multithreading. In this assignment you are required to execute the above task in multithreaded way. In particular, the program should read a double array (as above) from a file (whose name would be supplied by the user) and display all row sums and all column sums. Format of the output should be: Thread i calculates the row-i sum as Thread j calculates the column-j sum as If the double array dimension is m x n, then the program will have m x n threads to take care of m row sums and n column-sums. Note, your program may need to decide how many separate threads are needed, after reading the data from the supplied file. Submission: You can use Java (preferred) to solve the problem. Include your name, course name, semester, and assignment identifier (Assign 1) as program comments at the top of your code. Submit the source file(s) through BlazeVIEW submission box.

rowandcolum file:

88 79 86 115 87 26 20 114 109 0 61 75 48 59 99 36 22 53 30 17 106 0 90 12 32 7 58 31 94 17 78 83 112 74 34 102 0 45 34 66 75 117 61 115 96 28 11 76 41 87 63 69 109 73 48 99 1 69 34 67 13 93 10 39 117 36 104 73 73 11 104 29 49 89 111 110 4 83 78 63 88 22 99 19 115 59 65 91 16 96 81 104 54 12 80 46 101 3 19 59 0 8 109 28 64 47 49 33 42 87 69 111 55 82 84 68 50 15 7 16

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 And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

6. What is desktop management and why is it important?

Answered: 1 week ago