CodeGym /Courses /Java Multithreading /Practice with ThreadGroup

Practice with ThreadGroup

Java Multithreading
Level 8 , Lesson 4
Available

"Hi, Amigo!"

32
Task
Java Multithreading, level 8, lesson 4
Locked
Writing our own ThreadFactory
In the Solution class, create a public static AmigoThreadFactory class that implements the ThreadFactory interface. 1. The implementation of the interface's method must create and return a thread that: 1.1. is not a daemon, 1.2. has a normal priority level.
9
Task
Java Multithreading, level 8, lesson 4
Locked
ThreadLocalRandom
The Solution class will be used by threads. Implement all of the methods using the ThreadLocalRandom class. getRandomIntegerBetweenNumbers must return a random int between "from" and "to". getRandomDouble must return a random double.
Comments (6)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Maria Level 34, Utrecht, Netherlands
17 November 2020
ThreadFactory link
Andrei Level 41
17 May 2021
Cool, it worked, thanks!
Azamat Aminov Level 41, Tashkent, Uzbekistan
9 September 2020
This level missed ThreadLocal... No article about it although theme contains that name.
Seb Level 41, Crefeld, Germany
7 February 2020
For those who might like to have a little support for the first task - you can take a look at a good example of how to implement a ThreadFactory here: https://stackoverflow.com/questions/6113746/naming-threads-and-thread-pools-of-executorservice
Senned Level 41, Azov, Russia
15 November 2019
Don't forget about synhronizated for methods for first task.
Szymon Level 41, Warsaw, Poland
5 May 2021
I don't think those are necessary, since we use AtomicIntegers?