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
  • Introduction to multithreading: why it’s needed

    JAVA 25 SELF
    51 level,0 lecture
    Why programs need threads and parallelism: from a responsive interface to saturating all CPU cores. We’ll cover the difference between processes and threads, the role of the main thread main in the JVM, practical cases (UI, servers, file processing), and risks: race condition, deadlock, as well as basic synchronization tools like synchronized. We’ll show a simple example with Thread and running two tasks in parallel.
    Open
  • Starting threads: Thread and Runnable, syntax

    JAVA 25 SELF
    51 level,1 lecture
    In this lecture, we examine starting threads in Java: we get to know the Thread class and the Runnable interface, learn to call start() correctly and not confuse it with run(), use anonymous classes and lambda expressions, start multiple threads, and look at the lifecycle ( NEW → RUNNABLE → TERMINATED). We’ll discuss methods like Thread.currentThread(), getName(), waiting via join(), and common mistakes such as IllegalThreadStateException.
    Open
  • Thread states and lifecycle

    JAVA 25 SELF
    51 level,2 lecture
    We break down the thread lifecycle in Java: from Thread.State (
    NEW
    ,
    RUNNABLE
    ,
    BLOCKED
    ,
    WAITING
    ,
    TIMED_WAITING
    ,
    TERMINATED
    ) to the transitions between them. Learn to manage threads using Thread.sleep(...), join(), interrupt(), diagnose state via isAlive() and getState(), as well as avoid deprecated methods like stop()/ suspend()/ resume(). Finally — practical tips and common pitfalls.
    Open
  • Thread parameters and priorities

    JAVA 25 SELF
    51 level,3 lecture
    How to safely pass parameters to threads via the constructor of a class that implements Runnable, when lambda expressions are appropriate, and why it’s better to make fields final. We examine thread priorities: methods setPriority/ getPriority, constants Thread.MIN_PRIORITY, Thread.NORM_PRIORITY, Thread.MAX_PRIORITY and their effect on the scheduler. Plus—naming threads via the constructor, setName/ getName, a practical example, and common mistakes (shared Runnable, setters, relying on priorities).
    Open
  • Race condition (race condition)

    JAVA 25 SELF
    51 level,4 lecture
    In this lecture, we break down what a race condition is: when multiple threads simultaneously access shared data and the result depends on scheduling order. Using the increment counter ++ as an example, we show why the operation is not atomic and how increments get lost. We examine a practical bank-account case, production consequences, and protection approaches: synchronized, atomic types from java.util.concurrent.atomic (for example, AtomicInteger), as well as immutability. We wrap up with a “Common mistakes” section explaining why Thread bugs are rarely caught by tests and why trying to “cure” them with Thread. sleep( 1) is pointless.
    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