- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
#9 FizzBuzz with 4 Threads Explained | wait() vs Semaphore (Optimal Approach)
In this video, we solve the classic FizzBuzz multithreading problem using 4 threads in Java — where each thread is responsible for printing:
- Fizz (multiples of 3)
- Buzz (multiples of 5)
- FizzBuzz (multiples of 3 and 5)
- The number (otherwise)
Timelines:
00:00 - Intro & Agenda
00:18 - Problem Statement
02:32 - 1st Approach
04:05 - 1st Approach Code in IDE
11:43 - Why is this approach not optimal ?
14:18 - Intution of Optimal Approach using Semaphores
18:33 - Coding Optimal Approach in IDE
25:13 - Ending Notes and Next Video Agenda
We explore two approaches:
1. ✅ Using synchronized, wait() and notifyAll() — the traditional approach
2. ⚡ Using Semaphore — the optimized and efficient solution
You’ll learn:
- How thread synchronization works in Java
- The pitfalls of using wait() without notifyAll()
- Why semaphores provide better thread control
- How to avoid race conditions and deadlocks
🎓 Perfect for Java developers preparing for multithreading interviews or mastering concurrency concepts.
Github: https://github.com/AndyS12/Multithreading-in-Java/tree/main/Problems/src/MediumLevel/FooBar4Threads
LinkedIn: https://www.linkedin.com/in/anand-singh-sn/
Lecture Notes: https://drive.google.com/file/d/1WBTBsJd-3cq8ppho0B31_kr6GjDGovwr/view?usp=sharing
🔔 Don’t forget to like, subscribe, and share if you find this helpful!
#Java #Multithreading #Semaphores #ABCPrinterProblem #JavaInterview #ThreadSynchronization #JavaConcurrency #bitsofcode #bitsofcodeanand
Видео #9 FizzBuzz with 4 Threads Explained | wait() vs Semaphore (Optimal Approach) канала Bits of Code by Anand
- Fizz (multiples of 3)
- Buzz (multiples of 5)
- FizzBuzz (multiples of 3 and 5)
- The number (otherwise)
Timelines:
00:00 - Intro & Agenda
00:18 - Problem Statement
02:32 - 1st Approach
04:05 - 1st Approach Code in IDE
11:43 - Why is this approach not optimal ?
14:18 - Intution of Optimal Approach using Semaphores
18:33 - Coding Optimal Approach in IDE
25:13 - Ending Notes and Next Video Agenda
We explore two approaches:
1. ✅ Using synchronized, wait() and notifyAll() — the traditional approach
2. ⚡ Using Semaphore — the optimized and efficient solution
You’ll learn:
- How thread synchronization works in Java
- The pitfalls of using wait() without notifyAll()
- Why semaphores provide better thread control
- How to avoid race conditions and deadlocks
🎓 Perfect for Java developers preparing for multithreading interviews or mastering concurrency concepts.
Github: https://github.com/AndyS12/Multithreading-in-Java/tree/main/Problems/src/MediumLevel/FooBar4Threads
LinkedIn: https://www.linkedin.com/in/anand-singh-sn/
Lecture Notes: https://drive.google.com/file/d/1WBTBsJd-3cq8ppho0B31_kr6GjDGovwr/view?usp=sharing
🔔 Don’t forget to like, subscribe, and share if you find this helpful!
#Java #Multithreading #Semaphores #ABCPrinterProblem #JavaInterview #ThreadSynchronization #JavaConcurrency #bitsofcode #bitsofcodeanand
Видео #9 FizzBuzz with 4 Threads Explained | wait() vs Semaphore (Optimal Approach) канала Bits of Code by Anand
Комментарии отсутствуют
Информация о видео
24 июня 2025 г. 8:30:10
00:26:12
Другие видео канала





















