Multithreading
Threads Basics
Introduction to multithreading
Creating Threads
Thread class and Runnable interface
Thread Lifecycle
New, Runnable, Running, Waiting, Terminated
Thread Methods
start(), run(), sleep(), join(), etc.
Thread Priority
Setting and getting thread priorities
Synchronization
synchronized keyword
Synchronized Methods
Method-level synchronization
Synchronized Blocks
Block-level synchronization
Static Synchronization
Class-level locks
Inter-Thread Communication
wait(), notify(), notifyAll()
Deadlock
Understanding and preventing deadlocks
Thread Pool
Executor framework
ExecutorService
Managing thread execution
Callable and Future
Tasks that return results
CompletableFuture
Asynchronous programming (Java 8+)
Locks
ReentrantLock and Lock interface
ReadWriteLock
Multiple readers, single writer
Atomic Variables
AtomicInteger, AtomicLong, etc.
volatile Keyword
Visibility and ordering guarantees
ThreadLocal
Thread-confined variables
Semaphore
Controlling access to resources
CountDownLatch
Waiting for multiple threads
CyclicBarrier
Synchronization barrier
Concurrency Best Practices
Writing thread-safe code