1/35
Vocabulary-style flashcards covering the fundamental concepts of Java Multithreading, Concurrency, and Thread Management based on lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Process
A software program in execution with its own address space.
Thread
A smaller unit within a process, also known as a lightweight process, that represents a single sequential flow of control.
Main thread
The at least one thread that every software program possesses by default.
Resource utilization
The efficiency gained by allowing another program to run while a thread is waiting for external operations like input or output.
Time slicing
A fine-grained sharing method that allows multiple users and programs to have equal claims on a machine's resources.
New state
The phase in the thread life cycle where the thread is considered not alive.
Runnable (Ready-to-run) state
The state where a thread has started its life and is waiting for its turn on the processor.
Running state
The state in which the thread is currently executing.
Dead state
The state reached when a thread's run() method completes.
Blocked state
The state where a thread is waiting for resources that are currently held by another thread.
Thread.MIN_PRIORITY
The integer value 1 representing the minimum importance a thread can have.
Thread.MAX_PRIORITY
The integer value 10 representing the maximum importance a thread can have.
Thread.NORM_PRIORITY
The integer value 5, which is the default priority level for a thread.
join()
A method called by one thread on another thread to wait for the second thread to complete before proceeding.
yield()
A hint provided through the yield() method that the currently executing thread is willing to pause and allow other threads to execute.
sleep()
A method that causes the currently executing thread to pause for a specified number of milliseconds without releasing its lock.
Interruption
A mechanism whereby a thread that is waiting or sleeping can be made to prematurely stop waiting.
Preemptive Threads
A threading model where a higher-priority thread can interrupt a currently running lower-priority thread to take CPU time.
Non-Preemptible Threads
A threading model where a running thread cannot be interrupted and runs until it voluntarily yields control or finishes its task.
Daemon Thread
A low-priority service provider thread, such as the Garbage collector, that provides background services as long as the program is running.
Monitor
An intrinsic locking mechanism in Java where every object has a lock that can be held by only one thread at a time.
Race Conditions
A concurrency issue where multiple threads modify shared data simultaneously, leading to unpredictable or inconsistent states.
Mutex
Short for Mutual Exclusive; a locking mechanism where only the thread that locks the mutex can unlock it to ensure exclusive access.
Semaphore
A signaling mechanism that controls access to a shared resource through a counter.
Binary Semaphore
A type of semaphore similar to a mutex that uses a counter value of 0 or 1.
Counting Semaphore
A type of semaphore that allows a specified number of threads to access a resource.
Rule zero of concurrent programming
never make any assumptions.
wait()
An Object class method that causes the calling thread to release its lock and wait until another thread invokes notify() or notifyAll().
Inter-Thread Communication (IPC)
A mechanism using wait(), notify(), and notifyAll() that allows threads to communicate without race conditions.
Deadlock
A situation where two or more threads are unable to proceed because each is waiting for the other to release a resource, resulting in a standstill.
Priority inversion
A scenario where a lower-priority thread holds a resource needed by a higher-priority thread, effectively reversing their importance.
Starvation
A condition where a thread is perpetually denied the resources it needs because other threads are continuously given preference.
Mutual Exclusion (Deadlock Condition)
One of the four necessary conditions for deadlock, requiring at least one resource to be held in a non-sharable mode.
Hold and Wait (Deadlock Condition)
A condition for deadlock where a thread holding at least one resource is waiting to acquire additional resources.
No Preemption (Deadlock Condition)
A condition for deadlock where resources cannot be forcibly taken from a thread that is holding them.
Circular Wait (Deadlock Condition)
A condition for deadlock where a set of threads exists such that each thread is waiting for a resource held by the next thread in the cycle.