From the course: Advanced Java: Threads and Concurrency
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Challenge: Multiples calculator - Java Tutorial
From the course: Advanced Java: Threads and Concurrency
Challenge: Multiples calculator
(bright music) - [Instructor] Time for another challenge. In this challenge, you get to practice what you learned about the Fork/Join framework, mainly about the divide and conquer or recursive way of dealing with a large task, executing it as a ForkJoinTask in the ForkJoinPool. Here, I want you to work on a program named Multiples Calculator. This program finds the number of multiples of a given number in a list of random integers. The list of random integers can grow up to a size of 10 million or even more if you wish. The list size, divisor and the threshold value are obtained as user input. I provided the partially written code for you to complete. In the code, you can find two classes named MultiplesCalculator and MultiplesCalculatorMain. MultiplesCalculator represents the ForkJoinTask that you'll be implementing. You should write your code in these two classes. First of all, you should decide from which ForkJoinTask subclass should the MultiplesCalculator be extended. Then…
Contents
-
-
-
-
-
-
(Locked)
Thread execution and the fork/join framework4m 11s
-
(Locked)
Worker threads and work stealing3m 28s
-
(Locked)
The core classes of the fork/join framework4m 50s
-
(Locked)
Using the fork/join framework6m 36s
-
(Locked)
Challenge: Multiples calculator2m 15s
-
(Locked)
Solution: Multiples calculator3m 57s
-
(Locked)
-
-
-
-