AlexOreshkevich / M-JC1-83-21

GNU General Public License v3.0
2 stars 5 forks source link

Home Task 14 - Average Number Calculator #214

Open AlexOreshkevich opened 3 years ago

AlexOreshkevich commented 3 years ago

Calculate average number of some large amount of numbers, like 10E9.

Create several threads and distribute the total amount among them. Play with priorities and length of distributions.

Calculate partial sums and store them into the shared object or variable. Use volatile, synchronized or whatever appropriate.

Create unit test and compare performance of calculation and correctness with usual implementation using for cycle. Use https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html#average-- to demonstrate correctness of your calculations.

Optional: use https://www.baeldung.com/java-microbenchmark-harness for benchmarking