1/58
Vocabulary practice flashcards defining core concepts, thread states, mechanisms, synchronizers, and executor utilities in concurrent programming.
Process
A program in execution with its own memory and resources.
Sub-process
A process created by another process to perform a task.
Thread
A unit of execution within a process that shares process memory.
Concurrency
Multiple tasks make progress during overlapping periods.
Parallelism
Multiple tasks execute at exactly the same time.
Synchronous action
An action that participating processes must coordinate and perform together.
Determinism
The same initial conditions and inputs produce the same observable result.
Interference
One thread affects another through shared data.
Race condition
The result depends on the timing or order of concurrent operations.
Deadlock
Threads are permanently waiting for resources held by each other.
Starvation
A thread waits indefinitely while others repeatedly get the resources.
Critical section
Code accessing shared resources that needs protection.
Mutual exclusion
Only one thread at a time enters a particular critical section.
Thread class
A Java class extended to create a thread by overriding run().
Runnable interface
Defines a task that can be executed by a thread.
start() vs run()
start(): starts a new thread. run(): ordinary call on the current thread.
Thread priority
A scheduling hint indicating relative importance from 1 to 10.
Daemon thread
A background thread that does not prevent the JVM from exiting.
Thread group
A collection of threads organised for management.
NEW
Thread object created but start() not called.
RUNNABLE
Thread ready to run or currently executing.
BLOCKED
Thread waiting to acquire an intrinsic monitor lock.
WAITING
Thread waiting indefinitely for another thread action.
TIMED_WAITING
Thread waiting for a specified maximum time.
TERMINATED
Thread has finished execution.
Synchronisation
Coordinating threads to control access to shared resources.
Monitor
A mechanism combining a lock and condition waiting to coordinate shared state.
Lock
A mechanism controlling access to protected code.
synchronized
Uses an object monitor lock to ensure mutual exclusion.
Atomic operation
An operation that appears to execute in one indivisible step.
Semaphore
Controls access to shared resources using permits.
Binary semaphore
A semaphore with at most one available permit.
Counting semaphore
A semaphore allowing multiple permits.
Mutex
An exclusive lock that must be unlocked by its owner.
acquire()
Obtains a semaphore permit; blocks if none is available.
release()
Returns a permit to the semaphore.
tryAcquire()
Tries to obtain a permit without blocking by default.
Fairness
Giving waiting threads a fair chance to access resources.
wait()
Releases the object monitor and waits for notification or interruption.
notify()
Wakes one thread waiting on the same object monitor.
notifyAll()
Wakes all threads waiting on the same object monitor.
Readers-writers problem
Multiple readers can read together; writers need exclusive access.
CountDownLatch
Allows threads to wait until a counter reaches zero; not reusable.
CyclicBarrier
Fixed number of threads wait for each other; reusable.
Phaser
Coordinates threads through phases with flexible registration.
Exchanger
Lets two threads meet and exchange objects.
ExecutorService
Manages task execution and supports shutdown and Future.
Thread pool
A set of reusable worker threads executing tasks.
Fixed thread pool
A pool with a fixed number of worker threads.
Cached thread pool
Creates threads as needed and reuses idle threads.
Callable
A task that returns a result and may throw checked exceptions.
Future
Represents the result of an asynchronous computation.
Future.get()
Gets a task result, waiting if it is not yet available.
Future.isDone()
Checks whether a task has completed, failed or been cancelled.
Future.cancel()
Attempts to cancel a task.
Future.isCancelled()
Checks whether the task was successfully cancelled.
sleep() vs join()
sleep(): pause current thread. join(): wait for another thread to finish.
execute() vs submit()
execute(): runs task, no Future returned. submit(): returns Future.
shutdown() vs shutdownNow()
shutdown(): finish queued tasks. shutdownNow(): attempts immediate stop.