JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Shared resources and synchronization: access issues

    JAVA 25 SELF
    52 level,0 lecture
    This lecture is about what a shared resource is in multithreaded applications, why race conditions and “lost updates” occur, and how to protect data using synchronized. We will cover basic synchronization techniques (methods and blocks), talk about modern tools from java.util.concurrent ( Lock, ReentrantLock, Semaphore, etc.), and look at practical examples with incrementing a counter and typical mistakes (non-atomic i ++, wrong lock object, myths about volatile).
    Open
  • synchronized, volatile: syntax and usage

    JAVA 25 SELF
    52 level,1 lecture
    A practical lecture on multithreading: we examine how the synchronized keyword works (blocks and methods, the object monitor, and class-level locking via ClassName.class), how visibility via volatile differs from operation atomicity, why it’s convenient to make boolean flags volatile, and why incrementing count ++ requires synchronization. We’ll compare when to choose synchronized and when — volatile, and go through common mistakes.
    Open
  • ReentrantLock and ReadWriteLock: differences and examples

    JAVA 25 SELF
    52 level,2 lecture
    A practical comparison of classic synchronization via synchronized with more flexible primitives from the java.util.concurrent.locks package: ReentrantLock and ReadWriteLock. We will break down how to manage locks explicitly ( lock()/ unlock(), tryLock() with a timeout), how to scale reads using ReentrantReadWriteLock, what “fairness” ( fair mode) is, where each tool fits, and which mistakes are most common.
    Open
  • Mutexes and semaphores: syntax and tasks

    JAVA 25 SELF
    52 level,3 lecture
    In this lecture, we will examine the key synchronization primitives in Java: how to protect critical sections using synchronized and the ReentrantLock class (methods lock()/ unlock(), the try- finally pattern), and how to limit parallelism with Semaphore (methods acquire()/ release()). We will compare a mutex and a semaphore in a table, look at practical cases (a bank, a server with a connection limit), and typical mistakes that lead to deadlock and performance loss.
    Open
  • Breakdown of common synchronization mistakes

    JAVA 25 SELF
    52 level,4 lecture
    A hands-on breakdown of common Java concurrency mistakes: forgetting unlock()/ release() with ReentrantLock and Semaphore (fixed via try- finally), choosing the wrong monitor for synchronized, deadlocks and lock acquisition order, over-synchronization, plus the limits of volatile and switching to AtomicInteger. Examples, tips, and clear analogies—so your code doesn’t grind to a halt.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy