Загрузка...

#24 Reader-Writer Problem in Java | Why synchronized/wait/notify is NOT Enough ?

Every Java developer's first instinct for thread safety is synchronized. But what if synchronized is hurting your performance without you even realizing it?

In this video, we tackle the classic Reader-Writer Problem, a real concurrency challenge where multiple threads read shared data while one thread occasionally writes to it.

We start with no synchronization and see the chaos. Then we fix it with synchronized - correct, but secretly inefficient.

By the end, you'll understand WHY both tools fall short, and
exactly what kind of lock we actually need to solve this properly.

⚡ What You'll Learn:
→ What the Reader-Writer problem is and why it matters
→ Why synchronized serializes threads that don't need to wait
→ The difference between exclusive and shared locking
→ What ReentrantReadWriteLock is and why it exists

🗂️ This is Part 1 of the Reader-Writer Lock Problem:

⏱️ Timestamps:
00:00 - Introduction
00:25 - Problem Description
04:00 - Coding the Problem - broken solution
05:50 - Version 1: using synchronized
09:05 - Types of Locking
10:23 - Building the Custom Lock Class
13:31 - Code the Custom Lock Class
17:04 - Writer Starvation
18:57 - Solving Writer Starvation
23:21 - Reader Starvation
24:10 - ReentrantReadWriteLock Introduction


🔔 Subscribe to not miss the next parts!

#Java #Multithreading #JavaConcurrency #ReaderWriterProblem
#synchronized #ReentrantLock #JavaThreads #ConcurrencyInJava #bitsofcode #bitofcodebyanand

Видео #24 Reader-Writer Problem in Java | Why synchronized/wait/notify is NOT Enough ? канала Bits of Code by Anand
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять