Executor tasks

Java Multithreading
Level 8 , Lesson 10
Available

"Hi, Amigo!"

16
Task
Java Multithreading, level 8, lesson 10
Locked
Mastering Callable
Implement the getTask method. It should return a Callable object. The Callable object must calculate the sum of the numbers from 1 to the passed number (i), inclusive, and return it as a String. The main method is not tested.
32
Task
Java Multithreading, level 8, lesson 10
Locked
Plants vs Zombies
1. Read about java.util.concurrent.Phaser. 2. Put the methods in the right places: - arriveAndDeregister(): starts calling the tasks' run methods, - arriveAndAwaitAdvance(): waits for all threads to be created.
9
Task
Java Multithreading, level 8, lesson 10
Locked
ReentrantReadWriteLock
The ReadWriteMap class must correctly provide access to a Map object across multiple threads, but mistakes were made during implementation. Find them and fix them.
9
Task
Java Multithreading, level 8, lesson 10
Locked
FutureTask
The FactorialCalculator class is designed to calculate the factorial of a number passed to its constructor as an argument. Unfortunately, it is not implemented correctly and you need to fix it. Carefully analyze the Solution class's main method.
Comments (6)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
java_study Level 32, Minden, Germany
17 August 2022
Very complex tasks that require a lot of time. I didn't expect this. I really regret taking this course.
Justin Smith Level 41, Greenfield, USA, United States
5 May 2022
Yeah, this stuff is getting pretty hard. But remember that when you started CodeGym, upon completion of a task you would find that thousands of other people had completed the task as well. But now we find that only 200-300 people have completed these tasks. If you're finishing these you're doing a lot better than almost everyone else who started.
catalin1989 Level 37, Romania
12 March 2024
It is pretty lonely here. When I started, there were thousands of people, now there are hundreds :).
Andrei Level 41
18 May 2021
Also, this is a very good resource showing the differences between CyclicBarrier, Phaser and CountDownLatch - https://www.youtube.com/watch?v=J3QZ5gfCtAg
MaGaby2280 Level 41, Guatemala City, Guatemala
11 February 2021
These are some great links for the Java Phaser: https://www.baeldung.com/java-phaser https://www.geeksforgeeks.org/java-util-concurrent-phaser-class-in-java-with-examples/ https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Phaser.html
Seb Level 41, Crefeld, Germany
7 February 2020
A hint for Plants vs Zombies: The methods arriveAndDeregister() and arriveAndAwaitAdvance() need to be used in the start method - and they each need to be called only once.