CodeGym /Courses /Java Multithreading /Practice with concurrency

Practice with concurrency

Java Multithreading
Level 6 , Lesson 10
Available

"Hi, Amigo!"

14
Task
Java Multithreading, level 6, lesson 10
Locked
The world is boring for boring people
Analyze BlockingQueue. In the image and likeness of the Producer class, create a Consumer class that will output data from a BlockingQueue to the console.
14
Task
Java Multithreading, level 6, lesson 10
Locked
The world doesn't change, we change
Analyze ConcurrentHashMap. In a separate file, create a Producer class that will: 1. every half second, add a key and value to a ConcurrentHashMap, where the key is the counter starting from 1, and the value is a phrase like "Some text for i", e.g. "Some text for 1".
14
Task
Java Multithreading, level 6, lesson 10
Locked
The whole world is a comedy
Read more about java.util.concurrent.locks.Lock at http://docs.oracle.com/ (Everything there is in Javadocs!) Write the implementation of the someMethod() method: 1. try to acquire the lock; 1.1. if the lock is busy, then call the actionIfLockIsBusy() method; 1.2. if the lock is free, then.
Comments (4)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Alex Buyanov Level 47, Netherlands
31 October 2022
Read the docs. Nice. Though explanation of the type of locks would be nice before the tasks. But I believe, I will see this explanation in the next lesson...
Andrei Level 41
5 May 2021
Good exercises.
Andrei Level 41
4 August 2021
cool story, bro 👍
Justin Smith Level 41, Greenfield, USA, United States
20 February 2022
I felt like I was able to understand this material a lot more than the last set of 3 tasks.