52 questions for “Concurrency & Threads”

Found in 1 field. Select a question to see its full answer.

Information Technology

52 questions in 7 technologies

#QuestionTechnologyTopicLevel
1How does Java's virtual threads feature (Project Loom, finalized in Java 21) fundamentally change the thread-per-task model for high-concurrency applications, and how do they differ from traditional platform threads? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
2What is a race condition, and how does it differ conceptually from a deadlock as two distinct categories of concurrency bugs? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
3What are the two primary ways to create a thread in Java (extending Thread versus implementing Runnable), and which is generally preferred? Java › Concurrency & ThreadsJavaConcurrency & ThreadsBeginner
4What is the difference between calling Thread.start() and Thread.run() directly, and why is calling run() directly a common beginner mistake? Java › Concurrency & ThreadsJavaConcurrency & ThreadsBeginner
5What is the synchronized keyword, and how does it use Java's intrinsic (monitor) locks to prevent race conditions on shared mutable state? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
6What is the ExecutorService framework, and why is it generally preferred over manually creating and managing individual Thread objects? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
7What causes a deadlock in multithreaded Java code, and what is the classic "lock ordering" strategy for preventing it? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
8What are the atomic classes in java.util.concurrent.atomic (AtomicInteger, AtomicLong, AtomicReference), and how do they achieve thread-safe operations without traditional locking? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
9What is thread starvation, and how can thread priority misuse or unfair lock scheduling contribute to it? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
10What is the difference between wait()/notify()/notifyAll() (Object's intrinsic monitor methods) and the newer java.util.concurrent tools, and why are the older methods considered error-prone? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate